Skip to content

Commit

Permalink
Added replace tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo Prötel committed Dec 29, 2023
1 parent f0c35e6 commit 54fc7e8
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions regression-tests/pure2-new-basics.cpp2
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ test_movable_ref : () = {
}
}

test_movable_ref_replace : () = {
a : _ = new<Movable>();
if (a) {
a**.test();
}

a = new<Movable>();
if (a) {
a**.test();
}
}

test_copyable : () = {
a : Copyable = ();
a.test();
Expand Down Expand Up @@ -70,9 +82,24 @@ test_copyable_ref : () = {
}
}

test_copyable_ref_replace : () = {
a : _ = new<Copyable>();
if (a) {
a**.test();
}

a = new<Copyable>();
if (a) {
a**.test();
}
}


main: () = {
test_movable();
test_movable_ref();
test_movable_ref_replace();
test_copyable();
test_copyable_ref();
test_copyable_ref_replace();
}

0 comments on commit 54fc7e8

Please sign in to comment.