test/wcc/data: grow the declarative compiler corpus to 1,224 fixtures
The r-prefixed waves absorb the runtime, reject, and byte-compare rows of the migrated native carriers; each fixture is one directory with one case.ww and a //ww:error, //ww:compile, //ww:run, or //ww:run-exit directive covering both frontends.
This commit is contained in:
31
test/wcc/data/r778_stream_unread/case.ww
Normal file
31
test/wcc/data/r778_stream_unread/case.ww
Normal file
@@ -0,0 +1,31 @@
|
||||
//ww:run-exit 55
|
||||
// Migrated from 778_bufio_vstream_run row stream_unread.
|
||||
package main;
|
||||
import os;
|
||||
import bufio;
|
||||
import memio;
|
||||
import io;
|
||||
export fn main() i32 = {
|
||||
let raw: [4]u8;
|
||||
raw[0]=88u8; raw[1]=89u8; raw[2]=90u8;
|
||||
let mst: memio.stream = memio.dynamicfrom(raw[0:3]);
|
||||
let vs: io.stream = &mst.vt;
|
||||
let rbuf: [4]u8;
|
||||
let wbuf: [4]u8;
|
||||
let b: bufio.stream = bufio.init(vs, rbuf[0:4], wbuf[0:4]);
|
||||
let bvs: io.stream = &b.vt;
|
||||
let out: [4]u8;
|
||||
let rd = io.read(bvs, out[0:3]);
|
||||
let n: size = 0;
|
||||
if (rd is size) { n = rd as size; };
|
||||
if (n != 3: size || out[0] != 88u8 || out[2] != 90u8) { return 81; };
|
||||
let push: [2]u8;
|
||||
push[0]=88u8; push[1]=89u8;
|
||||
bufio.unread(&b, push[0:2]);
|
||||
let out2: [2]u8;
|
||||
let rd2 = io.read(bvs, out2[0:2]);
|
||||
let n2: size = 0;
|
||||
if (rd2 is size) { n2 = rd2 as size; };
|
||||
if (n2 != 2: size || out2[0] != 88u8 || out2[1] != 89u8) { return 82; };
|
||||
return 55;
|
||||
};
|
||||
Reference in New Issue
Block a user