Some formatting and updated test. Updated releasenotes.

This commit is contained in:
Christoffer Lerno
2025-03-07 00:14:41 +01:00
parent c790ecbca5
commit 5482107ca8
3 changed files with 7 additions and 21 deletions

View File

@@ -12,16 +12,8 @@ fn void test_float() @test
assert(String.to_float("-23.545")!! == -23.545f);
assert(String.to_float("1.5555555555555")!! == 1.5555555555555f);
assert(String.to_float("1.5555555555556666")!! == 1.5555555555556666f);
if (catch excuse = String.to_float("+")) {
assert(excuse == NumberConversion.MALFORMED_FLOAT);
} else {
assert(false);
}
if (catch excuse = String.to_float("-")) {
assert(excuse == NumberConversion.MALFORMED_FLOAT);
} else {
assert(false);
}
test::@error("+".to_float(), NumberConversion.MALFORMED_FLOAT);
test::@error("-".to_float(), NumberConversion.MALFORMED_FLOAT);
}
fn void test_double() @test
@@ -36,14 +28,6 @@ fn void test_double() @test
assert(String.to_double("-23.545")!! == -23.545);
assert(String.to_double("1.5555555555555")!! == 1.5555555555555);
assert(String.to_double("1.5555555555556666")!! == 1.5555555555556666);
if (catch excuse = String.to_double("+")) {
assert(excuse == NumberConversion.MALFORMED_FLOAT);
} else {
assert(false);
}
if (catch excuse = String.to_double("-")) {
assert(excuse == NumberConversion.MALFORMED_FLOAT);
} else {
assert(false);
}
test::@error("+".to_double(), NumberConversion.MALFORMED_FLOAT);
test::@error("-".to_double(), NumberConversion.MALFORMED_FLOAT);
}