Fix constant conversion checks (#6104)

This commit is contained in:
ske
2026-01-07 02:19:41 -03:00
parent 94cc5d9e61
commit 91c1950b9f
2 changed files with 14 additions and 25 deletions

View File

@@ -58,14 +58,14 @@ test_issue_6068 :: proc(t: ^testing.T) {
testing.expect(t, f64be(-1.234) == check_be)
testing.expect(t, cast(f64be)value == check_be)
testing.expect(t, cast(f64be)-1.234 == check_be)
testing.expect(t, f64be(int(-1.234)) == check_be)
testing.expect(t, cast(f64be)int(-1.234) == check_be)
testing.expect(t, f64be(f64(-1.234)) == check_be)
testing.expect(t, cast(f64be)f64(-1.234) == check_be)
testing.expect(t, f64le(value) == check_le)
testing.expect(t, f64le(-1.234) == check_le)
testing.expect(t, cast(f64le)value == check_le)
testing.expect(t, cast(f64le)-1.234 == check_le)
testing.expect(t, f64le(int(-1.234)) == check_le)
testing.expect(t, cast(f64le)int(-1.234) == check_le)
testing.expect(t, f64le(f64(-1.234)) == check_le)
testing.expect(t, cast(f64le)f64(-1.234) == check_le)
testing.expect(t, f64le(reverse) == check_le)
testing.expect(t, cast(f64le)reverse == check_le)
@@ -74,14 +74,14 @@ test_issue_6068 :: proc(t: ^testing.T) {
testing.expect(t, f64be(-1.234) == -1.234)
testing.expect(t, cast(f64be)value == -1.234)
testing.expect(t, cast(f64be)-1.234 == -1.234)
testing.expect(t, f64be(int(-1.234)) == -1.234)
testing.expect(t, cast(f64be)int(-1.234) == -1.234)
testing.expect(t, f64be(f64(-1.234)) == -1.234)
testing.expect(t, cast(f64be)f64(-1.234) == -1.234)
testing.expect(t, f64le(value) == -1.234)
testing.expect(t, f64le(-1.234) == -1.234)
testing.expect(t, cast(f64le)value == -1.234)
testing.expect(t, cast(f64le)-1.234 == -1.234)
testing.expect(t, f64le(int(-1.234)) == -1.234)
testing.expect(t, cast(f64le)int(-1.234) == -1.234)
testing.expect(t, f64le(f64(-1.234)) == -1.234)
testing.expect(t, cast(f64le)f64(-1.234) == -1.234)
testing.expect(t, f64le(reverse) == -1.234)
testing.expect(t, cast(f64le)reverse == -1.234)
}