Skip to content

Commit db2409a

Browse files
committed
test: added lexer test that detect issues from last changes
1 parent 5edec1f commit db2409a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dependency>
8080
<groupId>io.github.universal-variability-language</groupId>
8181
<artifactId>uvl-parser</artifactId>
82-
<version>0.4</version>
82+
<version>0.4.1</version>
8383
</dependency>
8484
<dependency>
8585
<groupId>org.junit.jupiter</groupId>

src/test/java/de/vill/parsing/ParsingTests.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public class ParsingTests {
2727
private static final String FAULTY_MODEL_PREFIX = TEST_MODEL_PREFIX + "faulty" + File.separator;
2828
private static final String COMPOSITION_MODEL_PREFIX = TEST_MODEL_PREFIX + "composition" + File.separator;
2929
private static final String COMPLEX_MODEL_PREFIX = TEST_MODEL_PREFIX + "complex" + File.separator;
30+
private static final String LEXING_MODEL_PREFIX = TEST_MODEL_PREFIX + "lexing" + File.separator;
31+
3032

3133
// sub sub directories
3234
private static final String NESTED_MODEL_PREFIX = COMPOSITION_MODEL_PREFIX + "nested" + File.separator;
@@ -74,6 +76,12 @@ public class ParsingTests {
7476
// Generated models
7577
private static final String GENERATED_DIRECTORY = TEST_MODEL_PREFIX + "generated";
7678

79+
// Lexing models
80+
private static final String DOT_IN_FEATURE_NAME = LEXING_MODEL_PREFIX + "dotinfeaturename.uvl";
81+
private static final String DOT_IN_STRING_CONSTANT = LEXING_MODEL_PREFIX + "dotinstringconstant.uvl";
82+
private static final String LEGAL_NUMBERS = LEXING_MODEL_PREFIX + "legalnumbers.uvl";
83+
84+
7785

7886

7987
// ------------------------------------------- Boolean level models -------------------------------------------
@@ -192,6 +200,15 @@ void checkCompositionModels() throws Exception {
192200
testModelParsing(NESTED_SUB_COMPOSITION_ROOT);
193201
}
194202

203+
// ------------------------------------------- Composition models ------------------------------------------------
204+
205+
@Test
206+
void checkLexingModels() throws Exception {
207+
testModelParsing(DOT_IN_FEATURE_NAME, false);
208+
testModelParsing(DOT_IN_STRING_CONSTANT);
209+
testModelParsing(LEGAL_NUMBERS);
210+
}
211+
195212

196213

197214
// ------------------------------------------- Helper methods ----------------------------------------------------

0 commit comments

Comments
 (0)