Skip to content

Commit

Permalink
Add initial unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sormuras committed Apr 23, 2024
1 parent d85148d commit 3188cee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions .idea/test.bach.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/test.bach/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
open /*test*/ module test.bach {
requires run.bach;
open /*for testing*/ module test.bach {
requires run.bach; // module under test
requires static org.junit.platform.console; // for running tests
requires org.junit.jupiter;
requires org.junit.platform.launcher; // for writing tests

provides java.util.spi.ToolProvider with
test.bach.BachTests;
Expand Down
21 changes: 21 additions & 0 deletions src/test.bach/test/java/test/bach/workflow/WorkflowTests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package test.bach.workflow;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import run.bach.workflow.Structure.Launcher;

class WorkflowTests {
@Nested
class StructureTests {
@Nested
class LauncherTests {
@ParameterizedTest
@ValueSource(strings = {"", "a", "=", "a=", "=a", "a=/", "a=a/", "a=/a"})
void illegalArgumentThrowsIllegalArgumentException(String s) {
Assertions.assertThrows(IllegalArgumentException.class, () -> Launcher.of(s));
}
}
}
}

0 comments on commit 3188cee

Please sign in to comment.