bigint::from_int(0) throws assertion #1944.

This commit is contained in:
Christoffer Lerno
2025-02-08 19:15:14 +01:00
parent 68b5c1e1f1
commit d3f2180330
3 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,14 @@ fn void test_parse16()
assert(bi.init_string_radix("c", 16)!!.equals(bigint::from_int(12)));
}
fn void test_zero()
{
assert(bigint::from_int(0).to_string(allocator::temp()) == "0");
BigInt bi;
bi.init_string_radix("00", 16)!!;
assert(bi.to_string(allocator::temp()) == "0");
}
fn void test_plus()
{
BigInt a = bigint::from_int(123);