File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class SystemProperties
32
32
extends mutable.AbstractMap [String , String ]
33
33
with mutable.Map [String , String ] {
34
34
35
- override def empty = new SystemProperties
35
+ override def empty = mutable. Map [ String , String ]()
36
36
override def default (key : String ): String = null
37
37
38
38
def iterator : Iterator [(String , String )] = wrapAccess {
Original file line number Diff line number Diff line change
1
+ package scala .util
2
+
3
+ import org .junit .runner .RunWith
4
+ import org .junit .runners .JUnit4
5
+ import org .junit .Test
6
+ import org .junit .Assert ._
7
+
8
+ @ RunWith (classOf [JUnit4 ])
9
+ class SystemPropertiesTest {
10
+ @ Test
11
+ def filterAll (): Unit = {
12
+ val isEmpty = sys.props.filter(_ => false ).size == 0
13
+ assertTrue(" A filter matching nothing should produce an empty result" , isEmpty)
14
+ }
15
+
16
+ @ Test
17
+ def filterNone (): Unit = {
18
+ val isUnchanged = sys.props.filter(_ => true ) == sys.props
19
+ assertTrue(" A filter matching everything should not change the result" , isUnchanged)
20
+ }
21
+
22
+ @ Test
23
+ def empty (): Unit = {
24
+ val hasSize0 = sys.props.empty.size == 0
25
+ assertTrue(" SystemProperties.empty should have size of 0" , hasSize0)
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments