summaryrefslogtreecommitdiffhomepage
path: root/tests/custom
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom')
-rw-r--r--tests/custom/99_bugs/49_trailing_garbage_string_as_number23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/custom/99_bugs/49_trailing_garbage_string_as_number b/tests/custom/99_bugs/49_trailing_garbage_string_as_number
new file mode 100644
index 0000000..1b48146
--- /dev/null
+++ b/tests/custom/99_bugs/49_trailing_garbage_string_as_number
@@ -0,0 +1,23 @@
+Ensure that numeric strings followed by non-whitespace are treated as NaN.
+
+-- Testcase --
+{%
+printf("%.J\n", [
+ "1" == 1,
+ " 1" == 1,
+ "1 " == 1,
+ "1a" == 1,
+ "1 a" == 1
+]);
+%}
+-- End --
+
+-- Expect stdout --
+[
+ true,
+ true,
+ true,
+ false,
+ false
+]
+-- End --