summaryrefslogtreecommitdiff
path: root/test/junit/scala/util/SystemPropertiesTest.scala
blob: 38e830eb8839e14fc10ad50c94a5643527f575a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)
  }
}