diff options
author | Som Snytt <som.snytt@gmail.com> | 2015-01-20 10:48:32 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2015-01-20 10:48:32 -0800 |
commit | 596c51cb75b1d05653d18c8b197183256c72da6d (patch) | |
tree | 9af7836830218842845f901eb1770d2fcc8be807 /test | |
parent | a3c2b55b16ad404b51f4eea0628dd00badeb0fbe (diff) | |
download | scala-596c51cb75b1d05653d18c8b197183256c72da6d.tar.gz scala-596c51cb75b1d05653d18c8b197183256c72da6d.tar.bz2 scala-596c51cb75b1d05653d18c8b197183256c72da6d.zip |
SI-6502 Convert test to asserts
This saves a check file in the crowded test directory.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t6502.check | 8 | ||||
-rw-r--r-- | test/files/run/t6502.scala | 46 |
2 files changed, 25 insertions, 29 deletions
diff --git a/test/files/run/t6502.check b/test/files/run/t6502.check deleted file mode 100644 index 95d36ee221..0000000000 --- a/test/files/run/t6502.check +++ /dev/null @@ -1,8 +0,0 @@ -test1 res1: true -test1 res2: true -test2 res1: true -test2 res2: true -test3 res1: true -test3 res2: true -test4 res1: true -test4 res2: true diff --git a/test/files/run/t6502.scala b/test/files/run/t6502.scala index b0d93ac3fd..52fabef6b8 100644 --- a/test/files/run/t6502.scala +++ b/test/files/run/t6502.scala @@ -59,11 +59,12 @@ object Test extends StoreReporterDirectTest { val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar", "test.Test.test()") val output = ILoop.run(codeToRun, settings) val lines = output.split("\n") - val res1 = lines(4).contains("Added") && lines(4).contains("test1.jar") - val res2 = lines(lines.length-3).contains("testing...") - - println(s"test1 res1: $res1") - println(s"test1 res2: $res2") + assert { + lines(4).contains("Added") && lines(4).contains("test1.jar") + } + assert { + lines(lines.length-3).contains("testing...") + } } def test2(): Unit = { @@ -75,11 +76,12 @@ object Test extends StoreReporterDirectTest { val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar1", s":require ${testOutput.path}/$jar2") val output = ILoop.run(codeToRun, settings) val lines = output.split("\n") - val res1 = lines(4).contains("Added") && lines(4).contains("test1.jar") - val res2 = lines(lines.length-3).contains("test2.jar") && lines(lines.length-3).contains("existing classpath entries conflict") - - println(s"test2 res1: $res1") - println(s"test2 res2: $res2") + assert { + lines(4).contains("Added") && lines(4).contains("test1.jar") + } + assert { + lines(lines.length-3).contains("test2.jar") && lines(lines.length-3).contains("existing classpath entries conflict") + } } def test3(): Unit = { @@ -91,11 +93,12 @@ object Test extends StoreReporterDirectTest { val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar1", s":require ${testOutput.path}/$jar3", "test.Test3.test()") val output = ILoop.run(codeToRun, settings) val lines = output.split("\n") - val res1 = lines(4).contains("Added") && lines(4).contains("test1.jar") - val res2 = lines(lines.length-3).contains("new object in existing package") - - println(s"test3 res1: $res1") - println(s"test3 res2: $res2") + assert { + lines(4).contains("Added") && lines(4).contains("test1.jar") + } + assert { + lines(lines.length-3).contains("new object in existing package") + } } def test4(): Unit = { @@ -104,11 +107,12 @@ object Test extends StoreReporterDirectTest { val codeToRun = toCodeInSeparateLines(s":require ${testOutput.path}/$jar1", s":require ${testOutput.path}/$jar1") val output = ILoop.run(codeToRun, settings) val lines = output.split("\n") - val res1 = lines(4).contains("Added") && lines(4).contains("test1.jar") - val res2 = lines(lines.length-3).contains("test1.jar") && lines(lines.length-3).contains("existing classpath entries conflict") - - println(s"test4 res1: $res1") - println(s"test4 res2: $res2") + assert { + lines(4).contains("Added") && lines(4).contains("test1.jar") + } + assert { + lines(lines.length-3).contains("test1.jar") && lines(lines.length-3).contains("existing classpath entries conflict") + } } def test5(): Unit = { @@ -138,5 +142,5 @@ object Test extends StoreReporterDirectTest { test6() } - def toCodeInSeparateLines(lines: String*): String = lines.map(_ + "\n").mkString + def toCodeInSeparateLines(lines: String*): String = lines mkString "\n" } |