added arg test
This commit is contained in:
parent
be1acae414
commit
82ebf2d645
@ -24,7 +24,6 @@ import dorkbox.executor.samples.TestSetup
|
|||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests passing empty arguments.
|
* Tests passing empty arguments.
|
||||||
@ -34,6 +33,14 @@ import java.util.*
|
|||||||
* @see ArgumentsAsList
|
* @see ArgumentsAsList
|
||||||
*/
|
*/
|
||||||
class EmptyArgTest {
|
class EmptyArgTest {
|
||||||
|
@Test
|
||||||
|
@Throws(Exception::class)
|
||||||
|
fun testGetArgs() {
|
||||||
|
val output = argumentsAsList("arg1", "", "arg3", "")
|
||||||
|
|
||||||
|
Assert.assertEquals(output.getArgs().size, 5) // because the java file is also one of the args.
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
fun testReadOutputAndError() {
|
fun testReadOutputAndError() {
|
||||||
@ -43,7 +50,7 @@ class EmptyArgTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertEquals("[arg1, , arg3, ]", output)
|
Assert.assertEquals("[arg1, , arg3, ]", output)
|
||||||
println(output)
|
// println(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun argumentsAsList(vararg args: String): Executor {
|
private fun argumentsAsList(vararg args: String): Executor {
|
||||||
|
Loading…
Reference in New Issue
Block a user