summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/04_bugs/29_empty_string_as_number
blob: 675f8a1eed1336ce60fbbf0cacc102b8ea9718ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 --