Commit 7504be923b
Changed files (2)
test
test/cases/misc.zig
@@ -424,6 +424,16 @@ fn intToPtrCast() {
}
+fn pointerComparison() {
+ @setFnTest(this);
+
+ const a = ([]u8)("a");
+ const b = &a;
+ assert(ptrEql(b, b));
+}
+fn ptrEql(a: &[]const u8, b: &[]const u8) -> bool {
+ a == b
+}
// TODO import from std.str
test/self_hosted.zig
@@ -38,18 +38,6 @@ fn testPassSliceOfEmptyStructToFn(slice: []EmptyStruct2) -> usize {
}
-// TODO not passing
-fn pointerComparison() {
- @setFnTest(this, true);
-
- const a = ([]u8)("a");
- const b = &a;
- assert(ptrEql(b, b));
-}
-fn ptrEql(a: &[]u8, b: &[]u8) -> bool {
- a == b
-}
-
// TODO change this test to an issue
// we're going to change how this works
fn switchOnErrorUnion() {