Skip to content

Commit

Permalink
added test for nonexistent lists
Browse files Browse the repository at this point in the history
  • Loading branch information
TTNO1 committed Nov 1, 2023
1 parent 7fcc54f commit e209723
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/io/github/ttno1/configvalidation/ConfigListTest.java
Expand Up @@ -49,6 +49,12 @@ void commonsConfigListValidationTest() {

assertTrue(result.passed(), result::getFailMessage);

ConfigValidationResult result2 = Cfg.newSpec()
.addNode("nonexistentList", Cfg.List.ofString())
.validate(wrapper);

assertFalse(result2.passed(), "Expected validation to fail for nonexstent list but passed.");

}

@Test
Expand Down Expand Up @@ -77,6 +83,12 @@ void snakeYamlListValidationTest() {

assertTrue(result.passed(), result::getFailMessage);

ConfigValidationResult result2 = Cfg.newSpec()
.addNode("nonexistentList", Cfg.List.ofString())
.validate(wrapper);

assertFalse(result2.passed(), "Expected validation to fail for nonexstent list but passed.");

}

}

0 comments on commit e209723

Please sign in to comment.