[strconv] Add parsing of Inf & NaN

This commit is contained in:
Jeroen van Rijn
2022-09-28 16:41:26 +02:00
parent efa86ddf46
commit cd910b1512
6 changed files with 247 additions and 207 deletions
+2 -17
View File
@@ -3,31 +3,16 @@ package test_issues
import "core:fmt"
import "core:testing"
import tc "tests:common"
/* Original issue #829 example */
env : map[string]proc(a, b : int) -> int = {
"+" = proc(a, b : int) -> int {
return a + b
},
}
test_orig :: proc() {
fmt.println(env["+"](1, 2))
}
main :: proc() {
t := testing.T{}
test_orig()
test_orig_ret(&t)
tc.report(&t)
}
@(test)
test_orig_ret :: proc(t: ^testing.T) {
r := fmt.tprint(env["+"](1, 2))
tc.expect(t, r == "3", fmt.tprintf("%s: \"%s\" != \"3\"\n", #procedure, r))
testing.expect(t, r == "3", fmt.tprintf("%s: \"%s\" != \"3\"\n", #procedure, r))
}