Merge pull request #42064 from Scony/add-numeric-literals-test-cases

Add test cases for numeric literals with underscores
This commit is contained in:
Rémi Verschelde 2020-09-14 21:07:00 +02:00 committed by GitHub
commit ee36e08c26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,6 +148,20 @@ TEST_CASE("[Expression] Scientific notation") {
"The expression should return the expected result."); "The expression should return the expected result.");
} }
TEST_CASE("[Expression] Underscored numeric literals") {
Expression expression;
CHECK_MESSAGE(
expression.parse("1_000_000") == OK,
"The expression should parse successfully.");
CHECK_MESSAGE(
expression.parse("1_000.000") == OK,
"The expression should parse successfully.");
CHECK_MESSAGE(
expression.parse("0xff_99_00") == OK,
"The expression should parse successfully.");
}
TEST_CASE("[Expression] Built-in functions") { TEST_CASE("[Expression] Built-in functions") {
Expression expression; Expression expression;