Skip to content

Commit 5fc736c

Browse files
authored
test: adds tests for lexing variables and constants (#23)
1 parent 7a02ec0 commit 5fc736c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ 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;
3031

3132
// sub sub directories
3233
private static final String NESTED_MODEL_PREFIX = COMPOSITION_MODEL_PREFIX + "nested" + File.separator;
@@ -74,6 +75,12 @@ public class ParsingTests {
7475
// Generated models
7576
private static final String GENERATED_DIRECTORY = TEST_MODEL_PREFIX + "generated";
7677

78+
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+
7784

7885

7986
// ------------------------------------------- Boolean level models -------------------------------------------
@@ -194,6 +201,17 @@ void checkCompositionModels() throws Exception {
194201

195202

196203

204+
// ------------------------------------------- Lexing models ------------------------------------------------
205+
206+
@Test
207+
void checkLexingModels() throws Exception {
208+
testModelParsing(DOT_IN_FEATURE_NAME, false);
209+
testModelParsing(DOT_IN_STRING_CONSTANT);
210+
testModelParsing(LEGAL_NUMBERS);
211+
}
212+
213+
214+
197215
// ------------------------------------------- Helper methods ----------------------------------------------------
198216

199217
private void testModelParsing(String path) {

0 commit comments

Comments
 (0)