Sha256: d7b3f0f23cb76bbc3db6919c5ea2d511e68e8908cd6068d9cb3af4611c2c8cb1

Contents?: true

Size: 1.31 KB

Versions: 148

Compression:

Stored size: 1.31 KB

Contents

import org.scalatest.{Matchers, FlatSpec}

/** @version created manually **/
class DequeTest extends FlatSpec with Matchers {

  it should "handle push then pop" in {
    val deque = Deque[Char]()
    deque.push('a')
    deque.push('b')
    deque.pop should be (Some('b'))
    deque.pop should be (Some('a'))
//    linkedList.pop should be (None)
  }

  it should "handle push then shift" in {
    pending
    val deque = Deque[Char]()
    deque.push('a')
    deque.push('b')
    deque.shift should be (Some('a'))
    deque.shift should be (Some('b'))
//    linkedList.shift should be (None)
  }

  it should "handle unshift then shift" in {
    pending
    val deque = Deque[Char]()
    deque.unshift('a')
    deque.unshift('b')
    deque.shift should be (Some('b'))
    deque.shift should be (Some('a'))
  }

  it should "handle unshift then pop" in {
    pending
    val deque = Deque[Char]()
    deque.unshift('a')
    deque.unshift('b')
    deque.pop should be (Some('a'))
    deque.pop should be (Some('b'))
  }

  it should "handle complex interaction" in {
    pending
    val deque = Deque[Int]()
    deque.push(1)
    deque.push(2)
    deque.pop should be (Some(2))
    deque.push(3)
    deque.unshift(4)
    deque.push(5)
    deque.shift should be (Some(4))
    deque.pop should be (Some(5))
    deque.pop should be (Some(3))
  }
}

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.179 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.178 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.177 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.176 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.175 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.174 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.173 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.172 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.171 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.170 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.169 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.167 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.166 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.165 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.164 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.163 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.162 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.161 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.160 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala