summaryrefslogtreecommitdiffhomepage
path: root/tests/custom
diff options
context:
space:
mode:
Diffstat (limited to 'tests/custom')
-rw-r--r--tests/custom/04_bugs/29_empty_string_as_number17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/custom/04_bugs/29_empty_string_as_number b/tests/custom/04_bugs/29_empty_string_as_number
new file mode 100644
index 0000000..675f8a1
--- /dev/null
+++ b/tests/custom/04_bugs/29_empty_string_as_number
@@ -0,0 +1,17 @@
+When an empty string was casted to a number, e.g. explicitly through `+`
+or `int()` or implicitly through numerical calculations, it was incorrectly
+treated as `NaN` and not `0`.
+
+-- Testcase --
+{{ +"" }}
+{{ int("") }}
+{{ "" + 0 }}
+{{ "" - 0.0 }}
+-- End --
+
+-- Expect stdout --
+0
+0
+0
+0
+-- End --