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:
18
test/wcc/data/r700_bytes_index/case.ww
Normal file
18
test/wcc/data/r700_bytes_index/case.ww
Normal file
@@ -0,0 +1,18 @@
|
||||
//ww:run-exit 7
|
||||
// Migrated from 700_e2e row 101.
|
||||
package main;
|
||||
import bytes;
|
||||
fn main() i32 = {
|
||||
let buf: [12]u8;
|
||||
buf[0] = 104u8; buf[1] = 101u8; buf[2] = 108u8; buf[3] = 108u8;
|
||||
buf[4] = 111u8; buf[5] = 44u8; buf[6] = 32u8; buf[7] = 119u8;
|
||||
buf[8] = 111u8; buf[9] = 114u8; buf[10] = 108u8; buf[11] = 100u8;
|
||||
let needle: [3]u8;
|
||||
needle[0] = 119u8; needle[1] = 111u8; needle[2] = 114u8;
|
||||
let r: (i32 | void) = bytes.index(buf[0:12], needle[0:3]);
|
||||
match (r) {
|
||||
case let i: i32 => return i;
|
||||
case void => return -1;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
Reference in New Issue
Block a user