mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Fix #2122
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user