diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-10-09 21:34:43 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2022-10-09 21:34:43 +0200 |
| commit | 4c78ba2152608563ef3e6eade8c6ebaabcec27b5 (patch) | |
| tree | c30044c5999d7273b53a262a5a8658d2ce36d6f9 /tests | |
| parent | 9870e43ac01895b45c90a01d4ae63bd899cdbb85 (diff) | |
Fix #2122
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/issues/test_issue_2087.odin | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/issues/test_issue_2087.odin b/tests/issues/test_issue_2087.odin index 19181bfca..26b6d487d 100644 --- a/tests/issues/test_issue_2087.odin +++ b/tests/issues/test_issue_2087.odin @@ -10,9 +10,13 @@ test_parse_float :: proc(t: ^testing.T) { { f, ok := strconv.parse_f64("1.2") testing.expect(t, ok && f == 1.2, "expected f64(1.2), fully consumed") - f, ok = strconv.parse_f64("1.2a") testing.expect(t, !ok && f == 1.2, "expected f64(1.2), partially consumed") + f, ok = strconv.parse_f64("+") + testing.expect(t, !ok && f == 0.0, "expected f64(0.0), with ok=false") + f, ok = strconv.parse_f64("-") + testing.expect(t, !ok && f == 0.0, "expected f64(0.0), with ok=false") + f, ok = strconv.parse_f64("inf") testing.expect(t, ok && math.classify(f) == math.Float_Class.Inf, "expected f64(+inf), fully consumed") |