mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
fix int formatting in std::collections::object
This commit is contained in:
committed by
Christoffer Lerno
parent
2ef1465244
commit
217151be8d
@@ -21,3 +21,21 @@ fn void test_general()
|
||||
root.set("yyy", true);
|
||||
assert(root.get_bool("yyy") ?? false);
|
||||
}
|
||||
|
||||
fn void test_to_format_int()
|
||||
{
|
||||
{
|
||||
Object* int_object = object::new_int(16, allocator::heap());
|
||||
defer int_object.free();
|
||||
String s = string::new_format("%s", int_object);
|
||||
defer free(s);
|
||||
assert(s == "16");
|
||||
}
|
||||
{
|
||||
Object* int_object = object::new_int(-16, allocator::heap());
|
||||
defer int_object.free();
|
||||
String s = string::new_format("%s", int_object);
|
||||
defer free(s);
|
||||
assert(s == "-16");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user