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.159 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.158 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.157 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.156 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.155 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.154 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.153 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.152 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.151 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.150 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.149 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.148 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.147 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.146 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.145 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.144 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.143 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.142 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.141 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala
trackler-2.2.1.140 tracks/scala/exercises/linked-list/src/test/scala/DequeTest.scala