Skip to content

Commit ec25ab5

Browse files
committed
Test for negatedTag argument
Also added a bit of logging
1 parent d7d1067 commit ec25ab5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/java/org/utplsql/cli/Cli.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package org.utplsql.cli;
22

3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
35
import picocli.CommandLine;
46

57
import java.util.List;
68

79
public class Cli {
810

11+
private static final Logger logger = LoggerFactory.getLogger(Cli.class);
12+
913
static final int DEFAULT_ERROR_CODE = 1;
1014

1115
public static void main(String[] args) {
@@ -17,6 +21,8 @@ public static void main(String[] args) {
1721

1822
static int runPicocliWithExitCode(String[] args) {
1923

24+
logger.debug("Args: "+String.join(", ", args));
25+
2026
CommandLine commandLine = new CommandLine(UtplsqlPicocliCommand.class);
2127
commandLine.setTrimQuotes(true);
2228

src/test/java/org/utplsql/cli/PicocliRunCommandTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,13 @@ void testFileMappingWithoutDetails() throws Exception {
240240
assertNull( testMapperConfig.getTypeSubexpression());
241241
assertNull( testMapperConfig.getNameSubexpression());
242242
}
243+
244+
@Test
245+
void negatedTag() throws Exception {
246+
RunCommandConfig config = parseForConfig("run",
247+
TestHelper.getConnectionString(),
248+
"--tags=\"-dontwantit\"");
249+
250+
assertThat(config.getTags(), hasItemInArray("-dontwantit") );
251+
}
243252
}

0 commit comments

Comments
 (0)