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.58 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.57 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.56 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.55 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.54 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.53 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.52 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.51 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.50 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.49 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.48 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.47 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.46 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.45 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.44 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.43 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.42 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.41 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.40 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.39 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala