diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-26 17:11:36 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-26 17:11:36 -0500 |
| commit | 15f843e70f18fe0cd7ee31a67af6eb8d6302dcbc (patch) | |
| tree | 1d6e98c5c8849690d7ea9e75960f9d0c3814240a /test/self_hosted.zig | |
| parent | 66a83d87383cd8de62898171b6665cb1d70af231 (diff) | |
| download | zig-15f843e70f18fe0cd7ee31a67af6eb8d6302dcbc.tar.gz zig-15f843e70f18fe0cd7ee31a67af6eb8d6302dcbc.zip | |
IR: pass castSliceToU8Slice test
Diffstat (limited to 'test/self_hosted.zig')
| -rw-r--r-- | test/self_hosted.zig | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/test/self_hosted.zig b/test/self_hosted.zig index 54219270d8..4b04ba4d5a 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -38,45 +38,3 @@ fn testPassSliceOfEmptyStructToFn(slice: []EmptyStruct2) -> usize { } -// TODO change this test to an issue -// we're going to change how this works -fn switchOnErrorUnion() { - @setFnTest(this, true); - - const x = switch (returnsTen()) { - Ok => |val| val + 1, - ItBroke, NoMem => 1, - CrappedOut => 2, - }; - assert(x == 11); -} -error ItBroke; -error NoMem; -error CrappedOut; -fn returnsTen() -> %i32 { - @setFnStaticEval(this, false); - 10 -} - -// TODO not passing -fn castSliceToU8Slice() { - @setFnTest(this); - - assert(@sizeOf(i32) == 4); - var big_thing_array = []i32{1, 2, 3, 4}; - const big_thing_slice: []i32 = big_thing_array; - const bytes = ([]u8)(big_thing_slice); - assert(bytes.len == 4 * 4); - bytes[4] = 0; - bytes[5] = 0; - bytes[6] = 0; - bytes[7] = 0; - assert(big_thing_slice[1] == 0); - const big_thing_again = ([]i32)(bytes); - assert(big_thing_again[2] == 3); - big_thing_again[2] = -1; - assert(bytes[8] == @maxValue(u8)); - assert(bytes[9] == @maxValue(u8)); - assert(bytes[10] == @maxValue(u8)); - assert(bytes[11] == @maxValue(u8)); -} |
