Quoted atoms
This commit is contained in:
parent
1e087c8339
commit
43b364044e
5 changed files with 65 additions and 32 deletions
|
@ -31,6 +31,26 @@ class TermsGrammarTests {
|
|||
Assertions.assertEquals(Atom(name), result, "Expected atom '$name'")
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(
|
||||
strings = [
|
||||
"'tick'",
|
||||
"\"doubleTick\"",
|
||||
"`backTick`",
|
||||
"'i have spaces'",
|
||||
"`i have a 'quote' inside`",
|
||||
"'I have Cases'",
|
||||
"'I, h@v3 many (!!!) special characters?! {}'"
|
||||
]
|
||||
)
|
||||
fun `Parse a quoted atom`(input: String) {
|
||||
val result = parser.parseToEnd(input)
|
||||
|
||||
val expected = input.substring(1, input.length - 1)
|
||||
|
||||
Assertions.assertEquals(Atom(expected), result, "Expected atom")
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = ["X", "X1", "X_1"])
|
||||
fun `parse variable`(name: String) {
|
||||
|
|
Reference in a new issue