added arg test

This commit is contained in:
Robinson 2021-08-29 00:58:27 -06:00
parent be1acae414
commit 82ebf2d645
1 changed files with 9 additions and 2 deletions

View File

@ -24,7 +24,6 @@ import dorkbox.executor.samples.TestSetup
import kotlinx.coroutines.runBlocking
import org.junit.Assert
import org.junit.Test
import java.util.*
/**
* Tests passing empty arguments.
@ -34,6 +33,14 @@ import java.util.*
* @see ArgumentsAsList
*/
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
@Throws(Exception::class)
fun testReadOutputAndError() {
@ -43,7 +50,7 @@ class EmptyArgTest {
}
Assert.assertEquals("[arg1, , arg3, ]", output)
println(output)
// println(output)
}
private fun argumentsAsList(vararg args: String): Executor {