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:
19
test/wcc/data/r700_strings_byteindex/case.ww
Normal file
19
test/wcc/data/r700_strings_byteindex/case.ww
Normal file
@@ -0,0 +1,19 @@
|
||||
//ww:run-exit 10
|
||||
// Migrated from 700_e2e row 100.
|
||||
package main;
|
||||
import strings;
|
||||
fn pick(r: (i32 | void), miss: i32) i32 = {
|
||||
match (r) {
|
||||
case let i: i32 => return i;
|
||||
case void => return miss;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
fn main() i32 = {
|
||||
let s: str = "hello, world";
|
||||
let i1: i32 = pick(strings.byteindex(s, ','), -1);
|
||||
let i2: i32 = pick(strings.byteindex(s, 'z'), -1);
|
||||
let i3: i32 = pick(strings.byteindex(s, "world"), -1);
|
||||
let i4: i32 = pick(strings.byteindex(s, "nope"), -1);
|
||||
return i1 + i2 + i3 + i4;
|
||||
};
|
||||
Reference in New Issue
Block a user