summaryrefslogtreecommitdiff
path: root/test/files/run/t3829.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-02-11 23:54:29 +0000
committerPaul Phillips <paulp@improving.org>2011-02-11 23:54:29 +0000
commit02fd6b6139dce48fffe46785fb6b588690885b26 (patch)
tree5f6aaa9806ca9536ccaa464452fc6a0265e3e58c /test/files/run/t3829.scala
parent593256a6ecc799e10cd6079a61e713aede854106 (diff)
downloadscala-02fd6b6139dce48fffe46785fb6b588690885b26.tar.gz
scala-02fd6b6139dce48fffe46785fb6b588690885b26.tar.bz2
scala-02fd6b6139dce48fffe46785fb6b588690885b26.zip
I chased a lot of ghosts before finding the rea...
I chased a lot of ghosts before finding the real culprit for why partest failures have been unfailing. Process(Seq("bash", "-c", "exit 42")) ! // 42 Process(Seq("bash", "-c", "exit 42")) #> logFile ! // 0 That behavior is not yet fixed, but I altered partest not to use #> and fixed the test which should have been failing but wasn't. Closes #4227, no review.
Diffstat (limited to 'test/files/run/t3829.scala')
-rw-r--r--test/files/run/t3829.scala32
1 files changed, 17 insertions, 15 deletions
diff --git a/test/files/run/t3829.scala b/test/files/run/t3829.scala
index a7d03f34eb..780a6a95b7 100644
--- a/test/files/run/t3829.scala
+++ b/test/files/run/t3829.scala
@@ -6,33 +6,35 @@ object Test {
val map = immutable.Map(1 -> 2, 3 -> 4)
assert(map.get(0) == None)
+ // Since r24255 defaultMap.get(x) returns None rather than
+ // using the default, so these mostly use apply.
val defmap = map.withDefaultValue(-1)
- assert(defmap.get(0) == Some(-1))
+ assert(defmap(0) == -1)
assert(defmap.size == 2)
assert(defmap.iterator.size == 2)
- assert(defmap.empty.get(0) == Some(-1))
- assert((defmap + (2 -> 3)).get(0) == Some(-1))
- assert((defmap + (2 -> 3)).get(1) == Some(2))
- assert((defmap + (2 -> 3)).get(2) == Some(3))
- assert((defmap - 1).get(0) == Some(-1))
- assert((defmap - 1).get(1) == Some(-1))
- assert((defmap - 1).get(3) == Some(4))
+ assert(defmap.empty(0) == -1)
+ assert((defmap + (2 -> 3))(0) == -1)
+ assert((defmap + (2 -> 3))(1) == 2)
+ assert((defmap + (2 -> 3))(2) == 3)
+ assert((defmap - 1)(0) == -1)
+ assert((defmap - 1)(1) == -1)
+ assert((defmap - 1)(3) == 4)
val mutmap = mutable.Map(1 -> 2, 2 -> 3)
assert(mutmap.get(0) == None)
val defmutmap = mutmap.withDefaultValue(-1)
- assert(defmutmap.get(0) == Some(-1))
- assert(defmutmap.get(3) == Some(-1))
+ assert(defmutmap(0) == -1)
+ assert(defmutmap(3) == -1)
mutmap += 3 -> 4
- assert(defmutmap.get(3) == Some(4))
- assert(defmutmap.get(1) == Some(2))
+ assert(defmutmap(3) == 4)
+ assert(defmutmap(1) == 2)
mutmap -= 1
- assert(defmutmap.get(1) == Some(-1))
+ assert(defmutmap(1) == -1)
assert(mutmap.get(1) == None)
defmutmap += 1 -> 2
- assert(defmutmap.get(1) == Some(2))
- assert(mutmap.get(1) == Some(2))
+ assert(defmutmap(1) == 2)
+ assert(mutmap(1) == 2)
}
}