diff --git a/src/test/java/org/openmainframeproject/cobolcheck/ArgumentHandlerTest.java b/src/test/java/org/openmainframeproject/cobolcheck/ArgumentHandlerTest.java index dbdc9151..e2deef49 100644 --- a/src/test/java/org/openmainframeproject/cobolcheck/ArgumentHandlerTest.java +++ b/src/test/java/org/openmainframeproject/cobolcheck/ArgumentHandlerTest.java @@ -144,4 +144,15 @@ public void it_throws_when_program_argument_is_not_present() { ex.getMessage()); } + @Test + public void it_throws_when_program_argument_is_not_presen_and_has_other_argument() { + Throwable ex = assertThrows(CommandLineArgumentException.class, () -> { + ArgumentHandler argumentHandler = new ArgumentHandler(new String[] {"-c", "config.properties" }, + optionSpec); + argumentHandler.loadArgProgramPaths(); + }); + assertEquals("ERR030: Command line missing program argument '-p programName' .", + ex.getMessage()); + } + }