Skip to content

Commit

Permalink
test: Verify string literal with regex characters
Browse files Browse the repository at this point in the history
  • Loading branch information
saig0 committed Sep 24, 2024
1 parent 58efca9 commit 544c038
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,26 @@ class InterpreterStringExpressionTest
}
}

private val regexCharacters = Table(
("Character", "Display name"),
("\\s", "\\s"),
("\\S", "\\S"),
("\\d", "\\d"),
("\\w", "\\w"),
("\\R", "\\R"),
("\\h", "\\h"),
("\\v", "\\v"),
("\\\n", "\\n"),
("\\\r", "\\r")
)

it should "contains a regex character" in {
forEvery(regexCharacters) { (character, _) =>
val expectedString = s"a $character b"

evaluateExpression(s" \"a $character b\" ") should returnResult(expectedString)
evaluateExpression("char", Map("char" -> expectedString)) should returnResult(expectedString)
}
}

}

0 comments on commit 544c038

Please sign in to comment.