diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-31 14:13:30 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-31 14:13:30 -0700 |
commit | 46616ea2e94fa6ac7100b1cde66295f68338e18e (patch) | |
tree | 9039f4b1bce71fa1b5a5ed721d0ee27d0751c015 /test/pending | |
parent | 59e21f37cb80215ada0db60363fb9f30adf6a0cd (diff) | |
parent | 8eb2853e19e03532c61963c87f3bf9f09cba5413 (diff) | |
download | scala-46616ea2e94fa6ac7100b1cde66295f68338e18e.tar.gz scala-46616ea2e94fa6ac7100b1cde66295f68338e18e.tar.bz2 scala-46616ea2e94fa6ac7100b1cde66295f68338e18e.zip |
Merge pull request #2783 from gkossakowski/merge-2.10.x
Merge 2.10.x into master
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/junit/scala/util/t7265.scala | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/pending/junit/scala/util/t7265.scala b/test/pending/junit/scala/util/t7265.scala new file mode 100644 index 0000000000..3b8fa80dbe --- /dev/null +++ b/test/pending/junit/scala/util/t7265.scala @@ -0,0 +1,46 @@ + +package scala.util +package test + +import org.junit.Assert._ +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +import scala.util.PropertiesTrait + +/** The java version property uses the spec version + * and must work for all "major.minor" and fail otherwise. + */ +@RunWith(classOf[JUnit4]) +class SpecVersionTest { + val sut = new PropertiesTrait { + override def javaSpecVersion = "1.7" + + override protected def pickJarBasedOn: Class[_] = ??? + override protected def propCategory: String = "test" + + // override because of vals like releaseVersion + override lazy val scalaProps = new java.util.Properties + } + + @Test + def comparesCorrectly(): Unit = { + assert(sut isJavaAtLeast "1.5") + assert(sut isJavaAtLeast "1.6") + assert(sut isJavaAtLeast "1.7") + assert(!(sut isJavaAtLeast "1.8")) + } + @Test(expected = classOf[NumberFormatException]) + def badVersion(): Unit = { + sut isJavaAtLeast "1.a" + } + @Test(expected = classOf[NumberFormatException]) + def missingVersion(): Unit = { + sut isJavaAtLeast "1" + } + @Test(expected = classOf[NumberFormatException]) + def notASpec(): Unit = { + sut isJavaAtLeast "1.7.1" + } +} |