Skip to content

Commit

Permalink
test: added tests for #1464
Browse files Browse the repository at this point in the history
  • Loading branch information
quintesse committed Sep 26, 2022
1 parent 6218b6f commit 32e6b25
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions itests/sources/yang.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//SOURCES **.java
1 change: 1 addition & 0 deletions itests/sources/ying.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//SOURCES yang.java
14 changes: 14 additions & 0 deletions src/test/java/dev/jbang/cli/TestInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,18 @@ void testInfoHelloJar() {
assertThat(info.mainClass, equalTo("helloworld"));
assertThat(info.resolvedDependencies, empty());
}

@Test
void testInfoStarSources() {
String src = examplesTestFolder.resolve("sources/ying.java").toString();
CommandLine.ParseResult pr = JBang.getCommandLine().parseArgs("info", "tools", src);
Tools tools = (Tools) pr.subcommand().subcommand().commandSpec().userObject();
BaseInfoCommand.ScriptInfo info = tools.getInfo();
assertThat(info.originalResource, equalTo(src));
// assertThat(info.applicationJar, equalTo(src));
assertThat(info.backingResource, equalTo(src));
// assertThat(info.javaVersion, not(nullValue()));
// assertThat(info.mainClass, equalTo("helloworld"));
assertThat(info.resolvedDependencies, empty());
}
}

0 comments on commit 32e6b25

Please sign in to comment.