diff options
Diffstat (limited to 'configgen/src/test/java/com/yahoo/config/codegen/DefLineParsingTest.java')
-rw-r--r-- | configgen/src/test/java/com/yahoo/config/codegen/DefLineParsingTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/configgen/src/test/java/com/yahoo/config/codegen/DefLineParsingTest.java b/configgen/src/test/java/com/yahoo/config/codegen/DefLineParsingTest.java index 0e2f6cc4d05..bb6b8eb64b4 100644 --- a/configgen/src/test/java/com/yahoo/config/codegen/DefLineParsingTest.java +++ b/configgen/src/test/java/com/yahoo/config/codegen/DefLineParsingTest.java @@ -1,6 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config.codegen; +import java.util.Optional; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -246,4 +247,24 @@ public class DefLineParsingTest { assertTrue(r1.getRestart()); } + @Test + void testParseOptionalPathWithDefault() { + DefLine l = new DefLine("pathWithDef path optional"); + + assertEquals("pathWithDef", l.getName()); + assertNull(l.getDefault()); + assertTrue(l.isOptional()); + assertEquals("optionalPath", l.getType().getName()); + } + + @Test + void testParsPathWithDefault() { + DefLine l = new DefLine("pathWithDef path"); + + assertEquals("pathWithDef", l.getName()); + assertNull(l.getDefault()); + assertFalse(l.isOptional()); + assertEquals("path", l.getType().getName()); + } + } |