File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
scala-core-collections-2/src/test/scala-2/com/baeldung/scala/subarray Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
- package com .baeldung .scala .arrays
1
+ package com .baeldung .scala .subarray
2
2
3
3
import org .scalatest .flatspec .AnyFlatSpec
4
4
import org .scalatest .matchers .should .Matchers
@@ -10,7 +10,7 @@ class GetASubarrayUnitTest extends AnyFlatSpec with Matchers {
10
10
val subArr = arr.slice(1 , 4 )
11
11
12
12
subArr.length should be(3 )
13
- subArr( 0 ) should be( 2 )
13
+ subArr should contain theSameElementsAs List ( 2 , 3 , 4 )
14
14
}
15
15
16
16
" operating drop and take functions on an array" should " return a subarray of the taken elements" in {
@@ -22,7 +22,7 @@ class GetASubarrayUnitTest extends AnyFlatSpec with Matchers {
22
22
23
23
val subArr = afterDropArr.take(3 )
24
24
subArr.length should be(3 )
25
- subArr( 0 ) should be( 2 )
25
+ subArr should contain theSameElementsAs List ( 2 , 3 , 4 )
26
26
}
27
27
28
28
}
You can’t perform that action at this time.
0 commit comments