summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-09-14 21:07:00 +0200
committerGitHub <noreply@github.com>2020-09-14 21:07:00 +0200
commitee36e08c2656a64dede15d8681b0c4c7db55efee (patch)
tree6f940ad344c0997f32def1c858fa5b04f9c030f3
parent2b0e1dc87d88ac338ede1db94dfaf6d7cea2ac8b (diff)
parentb2d8c5140ed21be9a4550de2bd03876ae38fc8e8 (diff)
Merge pull request #42064 from Scony/add-numeric-literals-test-cases
Add test cases for numeric literals with underscores
-rw-r--r--tests/test_expression.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_expression.h b/tests/test_expression.h
index 85d37d1460..8c026a35f5 100644
--- a/tests/test_expression.h
+++ b/tests/test_expression.h
@@ -148,6 +148,20 @@ TEST_CASE("[Expression] Scientific notation") {
"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") {
Expression expression;