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.119 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.118 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.117 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.116 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.115 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.114 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.113 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.111 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.110 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.109 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.108 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.107 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.106 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.105 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.104 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.103 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.102 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.101 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.100 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.99 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala