diff options
author | Shane Delmore <shane@delmore.io> | 2015-12-07 22:02:23 -0800 |
---|---|---|
committer | Shane Delmore <shane@delmore.io> | 2015-12-10 12:57:19 -0800 |
commit | de1d294f5e2349fe9bcbc6a44990c8f641f71d37 (patch) | |
tree | 335ed852218fe487dc61626dbb0a357cf1c722a7 /test | |
parent | d5c74a245d95822c353bff514cb92e144a607967 (diff) | |
download | scala-de1d294f5e2349fe9bcbc6a44990c8f641f71d37.tar.gz scala-de1d294f5e2349fe9bcbc6a44990c8f641f71d37.tar.bz2 scala-de1d294f5e2349fe9bcbc6a44990c8f641f71d37.zip |
SI-9583: Update SystemProperties.empty to return a mutable.Map to fix builders
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/util/SystemPropertiesTest.scala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/junit/scala/util/SystemPropertiesTest.scala b/test/junit/scala/util/SystemPropertiesTest.scala new file mode 100644 index 0000000000..38e830eb88 --- /dev/null +++ b/test/junit/scala/util/SystemPropertiesTest.scala @@ -0,0 +1,27 @@ +package scala.util + +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 +import org.junit.Test +import org.junit.Assert._ + +@RunWith(classOf[JUnit4]) +class SystemPropertiesTest { + @Test + def filterAll(): Unit = { + val isEmpty = sys.props.filter(_ => false).size == 0 + assertTrue("A filter matching nothing should produce an empty result", isEmpty) + } + + @Test + def filterNone(): Unit = { + val isUnchanged = sys.props.filter(_ => true) == sys.props + assertTrue("A filter matching everything should not change the result", isUnchanged) + } + + @Test + def empty(): Unit = { + val hasSize0 = sys.props.empty.size == 0 + assertTrue("SystemProperties.empty should have size of 0", hasSize0) + } +} |