diff options
Diffstat (limited to 'test/junit/scala/sys/process/ProcessTest.scala')
-rw-r--r-- | test/junit/scala/sys/process/ProcessTest.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/junit/scala/sys/process/ProcessTest.scala b/test/junit/scala/sys/process/ProcessTest.scala new file mode 100644 index 0000000000..f6d779c2c8 --- /dev/null +++ b/test/junit/scala/sys/process/ProcessTest.scala @@ -0,0 +1,25 @@ +package scala.sys.process + +import java.io.ByteArrayInputStream +// should test from outside the package to ensure implicits work +//import scala.sys.process._ +import scala.util.Properties._ + +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 +import org.junit.Test +import org.junit.Assert.assertEquals + +@RunWith(classOf[JUnit4]) +class ProcessTest { + private def testily(body: => Unit) = if (!isWin) body + @Test def t10007(): Unit = testily { + val res = ("cat" #< new ByteArrayInputStream("lol".getBytes)).!! + assertEquals("lol\n", res) + } + // test non-hanging + @Test def t10055(): Unit = testily { + val res = ("cat" #< ( () => -1 ) ).! + assertEquals(0, res) + } +} |