mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Removing use of $assignable and deprecate it. Fix regression for stacktraces on MacOS. Added readline_to_stream. Regression: Chaining an optional together with contracts could in some cases lose the optional.
This commit is contained in:
@@ -6,7 +6,7 @@ alias IntMap = HashMap{String, int};
|
||||
fn void copy_map() @test
|
||||
{
|
||||
TrackingAllocator alloc;
|
||||
alloc.init(allocator::heap());
|
||||
alloc.init(mem);
|
||||
defer alloc.free();
|
||||
assert(alloc.allocated() == 0);
|
||||
mem::@scoped(&alloc)
|
||||
|
||||
@@ -3,14 +3,14 @@ import std::collections::object;
|
||||
|
||||
fn void test_general()
|
||||
{
|
||||
Object* root = object::new_obj(allocator::heap());
|
||||
Object* root = object::new_obj(mem);
|
||||
defer root.free();
|
||||
|
||||
root.set("foo", 1);
|
||||
root.set("bar", "baz");
|
||||
assert(root.get_int("foo")!! == 1);
|
||||
assert(root.get_string("bar")!! == "baz");
|
||||
Object* goo = root.set("goo", object::new_obj(allocator::heap()));
|
||||
Object* goo = root.set("goo", object::new_obj(mem));
|
||||
goo.push("hello");
|
||||
goo.push(132);
|
||||
assert(root.get("goo").get_int_at(1)!! == 132);
|
||||
@@ -27,14 +27,14 @@ fn void test_general()
|
||||
fn void test_to_format_int()
|
||||
{
|
||||
{
|
||||
Object* int_object = object::new_int(16, allocator::heap());
|
||||
Object* int_object = object::new_int(16, mem);
|
||||
defer int_object.free();
|
||||
String s = string::format(mem, "%s", int_object);
|
||||
defer free(s);
|
||||
assert(s == "16");
|
||||
}
|
||||
{
|
||||
Object* int_object = object::new_int(-16, allocator::heap());
|
||||
Object* int_object = object::new_int(-16, mem);
|
||||
defer int_object.free();
|
||||
String s = string::format(mem, "%s", int_object);
|
||||
defer free(s);
|
||||
|
||||
Reference in New Issue
Block a user