test: migrate 700_e2e rows to corpus fixtures; retire the carrier
136 rows migrated, 0 already owned, 3 wwstage-failing rows held out.
This commit is contained in:
22
test/wcc/data/r700_nullable_match/case.ww
Normal file
22
test/wcc/data/r700_nullable_match/case.ww
Normal file
@@ -0,0 +1,22 @@
|
||||
//ww:run-exit 7
|
||||
// Migrated from 700_e2e row 66.
|
||||
package main;
|
||||
fn lookup(p: *i32, b: bool) (*i32 | void) = {
|
||||
if (b) { return p; };
|
||||
return;
|
||||
};
|
||||
fn use_arg(r: (*i32 | void)) i32 = {
|
||||
match (r) {
|
||||
case let q: *i32 => return *q;
|
||||
case void => return 99;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
fn main() i32 = {
|
||||
let x: i32 = 42;
|
||||
let ok: i32 = use_arg(lookup(&x, true));
|
||||
let no: i32 = use_arg(lookup(&x, false));
|
||||
if (ok != 42) { return 1; };
|
||||
if (no != 99) { return 2; };
|
||||
return 7;
|
||||
};
|
||||
Reference in New Issue
Block a user