Skip to content

Instantly share code, notes, and snippets.

@nephilim
Created May 13, 2012 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nephilim/2683856 to your computer and use it in GitHub Desktop.
Save nephilim/2683856 to your computer and use it in GitHub Desktop.
ScalaTest Spec for 20120513 Lasdan Competition
package pis.chap22.multimap
import org.junit.runner.RunWith
import org.scalatest.Spec
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class LasMultiMapSpec extends Spec {
describe("정의한 LasDan MultiMap의 기본 동작을 확인한다") {
it ("기본 동작") {
val mmap = new LasMultiMap[String,String]();
val key = "a-Key"
//mmap.put(key,"A");
mmap(key) = "A";
assert( mmap(key)(0) == "A" )
mmap(key) = "B"
assert( mmap(key)(1) == "B")
assert( mmap(key) == List("A","B"))
mmap(key) = "B"
assert( mmap(key) == List("A","B","B"))
assert( mmap.keySet() == Set(key))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment