| author | |
| committer | |
| log | 7504be923b1721a5a5e094a306aad029887270e8 |
| tree | cd678f8774e42291ae128e5809b2f46342745cb6 |
| parent | 735cdbfdaca6405d1465ea859032412499c658d8 |
2 files changed, 10 insertions(+), 12 deletions(-)
test/cases/misc.zig+10| ... | @@ -424,6 +424,16 @@ fn intToPtrCast() { | ... | @@ -424,6 +424,16 @@ fn intToPtrCast() { |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | 426 | ||
| 427 | fn pointerComparison() { | ||
| 428 | @setFnTest(this); | ||
| 429 | |||
| 430 | const a = ([]u8)("a"); | ||
| 431 | const b = &a; | ||
| 432 | assert(ptrEql(b, b)); | ||
| 433 | } | ||
| 434 | fn ptrEql(a: &[]const u8, b: &[]const u8) -> bool { | ||
| 435 | a == b | ||
| 436 | } | ||
| 427 | 437 | ||
| 428 | 438 | ||
| 429 | // TODO import from std.str | 439 | // TODO import from std.str |
test/self_hosted.zig-12| ... | @@ -38,18 +38,6 @@ fn testPassSliceOfEmptyStructToFn(slice: []EmptyStruct2) -> usize { | ... | @@ -38,18 +38,6 @@ fn testPassSliceOfEmptyStructToFn(slice: []EmptyStruct2) -> usize { |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | // TODO not passing | ||
| 42 | fn pointerComparison() { | ||
| 43 | @setFnTest(this, true); | ||
| 44 | |||
| 45 | const a = ([]u8)("a"); | ||
| 46 | const b = &a; | ||
| 47 | assert(ptrEql(b, b)); | ||
| 48 | } | ||
| 49 | fn ptrEql(a: &[]u8, b: &[]u8) -> bool { | ||
| 50 | a == b | ||
| 51 | } | ||
| 52 | |||
| 53 | // TODO change this test to an issue | 41 | // TODO change this test to an issue |
| 54 | // we're going to change how this works | 42 | // we're going to change how this works |
| 55 | fn switchOnErrorUnion() { | 43 | fn switchOnErrorUnion() { |