diff options
Diffstat (limited to 'test/files/run/mutable-treeset.scala')
-rw-r--r-- | test/files/run/mutable-treeset.scala | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/files/run/mutable-treeset.scala b/test/files/run/mutable-treeset.scala index c9918cba96..100ab39965 100644 --- a/test/files/run/mutable-treeset.scala +++ b/test/files/run/mutable-treeset.scala @@ -9,21 +9,21 @@ object Test extends App { val min = list.min val max = list.max val nonlist = ((min - 10) until (max + 20) filterNot list.contains).toList - val sublist = list filter {x => x >=(min + 1) && x < max} - val distinctSublist = sublist.distinct + val sublist = list filter {x => x >=(min + 1) && x < max} + val distinctSublist = sublist.distinct val subnonlist = min :: max :: nonlist val subsorted = distinctSublist.sorted // subsublist for a 2nd level of slicing val almostmin = sublist.min val almostmax = sublist.max - val subsublist = sublist filter {x => x >=(almostmin + 1) && x < almostmax} - val distinctSubsublist = subsublist.distinct + val subsublist = sublist filter {x => x >=(almostmin + 1) && x < almostmax} + val distinctSubsublist = subsublist.distinct val subsubnonlist = almostmin :: almostmax :: subnonlist val subsubsorted = distinctSubsublist.sorted def testSize { - def check(set : TreeSet[Int], list: List[Int]) { + def check(set : TreeSet[Int], list: List[Int]) { assert(set.size == list.size, s"$set had size ${set.size} while $list had size ${list.size}") } @@ -46,7 +46,7 @@ object Test extends App { assert(list forall set.apply, s"$set did not contain all elements of $list using apply") assert(list forall set.contains, s"$set did not contain all elements of $list using contains") assert(!(nonlist exists set.apply), s"$set had an element from $nonlist using apply") - assert(!(nonlist exists set.contains), s"$set had an element from $nonlist using contains") + assert(!(nonlist exists set.contains), s"$set had an element from $nonlist using contains") } val set = TreeSet(list:_*) @@ -72,11 +72,11 @@ object Test extends App { assert(builtList.size == set.size, s"$set had size ${set.size} while $builtList had size ${builtList.size}") } assert(!(nonlist exists set.apply), s"$set had an element from $nonlist using apply") - assert(!(nonlist exists set.contains), s"$set had an element from $nonlist using contains") + assert(!(nonlist exists set.contains), s"$set had an element from $nonlist using contains") } val set = TreeSet[Int]() - val clone = set.clone + val clone = set.clone val subset = set.clone from (min + 1) until max val subclone = subset.clone val subsubset = subset.clone from (almostmin + 1) until almostmax @@ -100,10 +100,10 @@ object Test extends App { builtList = builtList filterNot (_ == x) assert(builtList forall set.apply, s"$set did not contain all elements of $builtList using apply") assert(builtList.size == set.size, s"$set had size $set.size while $builtList had size $builtList.size") - } + } } val set = TreeSet(list:_*) - val clone = set.clone + val clone = set.clone val subset = set.clone from (min + 1) until max val subclone = subset.clone val subsubset = subset.clone from (almostmin + 1) until almostmax @@ -114,7 +114,7 @@ object Test extends App { check(subset, subsorted) check(subclone, subsorted) - + check(subsubset, subsubsorted) check(subsubclone, subsubsorted) } |