diff options
Diffstat (limited to 'tests/features/test_copy_trait.zc')
| -rw-r--r-- | tests/features/test_copy_trait.zc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/features/test_copy_trait.zc b/tests/features/test_copy_trait.zc index 120dc5d..994ccee 100644 --- a/tests/features/test_copy_trait.zc +++ b/tests/features/test_copy_trait.zc @@ -12,7 +12,7 @@ struct Mover { val: int; } -fn test_copy_trait() { +test "copy_trait" { var p1 = Point { x: 10, y: 20 }; var p2 = p1; // Copy, not move @@ -24,18 +24,14 @@ fn test_copy_trait() { p2.x = 30; assert(p1.x == 10, "p1 changed after p2 modification"); assert(p2.x == 30, "p2 modification failed"); + + println "Copy Trait Works!"; } -fn test_move_default() { +test "move_default" { var m1 = Mover { val: 1 }; var m2 = m1; // Moved // Uncommenting this should cause compile error // var m3 = m1; } - -fn main() { - test_copy_trait(); - test_move_default(); - "Copy Trait Works!"; -} |
