diff options
| author | Martin Wickham <spexguy070@gmail.com> | 2021-09-23 12:17:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-23 13:17:06 -0400 |
| commit | a0a847f2e40046387e2e2b8a0b8dae9cb27ca22a (patch) | |
| tree | 2fdaa3bdd0ab7d63eb54e1bd92aca1f1607cca14 /test | |
| parent | f615648d7bdcb5c7ed38ad15169a8fa90bd86ca0 (diff) | |
| download | zig-a0a847f2e40046387e2e2b8a0b8dae9cb27ca22a.tar.gz zig-a0a847f2e40046387e2e2b8a0b8dae9cb27ca22a.zip | |
Stage2: Implement comptime closures and the This builtin (#9823)
Diffstat (limited to 'test')
| -rw-r--r-- | test/behavior.zig | 19 | ||||
| -rw-r--r-- | test/behavior/this.zig | 9 |
2 files changed, 14 insertions, 14 deletions
diff --git a/test/behavior.zig b/test/behavior.zig index 78f3651b01..3a5c0fe589 100644 --- a/test/behavior.zig +++ b/test/behavior.zig @@ -1,20 +1,22 @@ const builtin = @import("builtin"); test { - _ = @import("behavior/bool.zig"); + // Tests that pass for both. + _ = @import("behavior/array.zig"); + _ = @import("behavior/atomics.zig"); _ = @import("behavior/basic.zig"); - _ = @import("behavior/generics.zig"); + _ = @import("behavior/bool.zig"); + _ = @import("behavior/cast.zig"); _ = @import("behavior/eval.zig"); - _ = @import("behavior/pointers.zig"); + _ = @import("behavior/generics.zig"); _ = @import("behavior/if.zig"); - _ = @import("behavior/cast.zig"); - _ = @import("behavior/array.zig"); - _ = @import("behavior/usingnamespace.zig"); - _ = @import("behavior/atomics.zig"); + _ = @import("behavior/pointers.zig"); _ = @import("behavior/sizeof_and_typeof.zig"); - _ = @import("behavior/translate_c_macros.zig"); _ = @import("behavior/struct.zig"); + _ = @import("behavior/this.zig"); + _ = @import("behavior/translate_c_macros.zig"); _ = @import("behavior/union.zig"); + _ = @import("behavior/usingnamespace.zig"); _ = @import("behavior/widening.zig"); if (builtin.zig_is_stage2) { @@ -142,7 +144,6 @@ test { _ = @import("behavior/switch.zig"); _ = @import("behavior/switch_prong_err_enum.zig"); _ = @import("behavior/switch_prong_implicit_cast.zig"); - _ = @import("behavior/this.zig"); _ = @import("behavior/truncate.zig"); _ = @import("behavior/try.zig"); _ = @import("behavior/tuple.zig"); diff --git a/test/behavior/this.zig b/test/behavior/this.zig index 086fe2814a..0fcfd5910c 100644 --- a/test/behavior/this.zig +++ b/test/behavior/this.zig @@ -24,11 +24,10 @@ test "this refer to module call private fn" { } test "this refer to container" { - var pt = Point(i32){ - .x = 12, - .y = 34, - }; - pt.addOne(); + var pt: Point(i32) = undefined; + pt.x = 12; + pt.y = 34; + Point(i32).addOne(&pt); try expect(pt.x == 13); try expect(pt.y == 35); } |
