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:
26
test/wcc/data/r778_stream_setflush/case.ww
Normal file
26
test/wcc/data/r778_stream_setflush/case.ww
Normal file
@@ -0,0 +1,26 @@
|
||||
//ww:run-exit 54
|
||||
// Migrated from 778_bufio_vstream_run row stream_setflush.
|
||||
package main;
|
||||
import os;
|
||||
import bufio;
|
||||
import memio;
|
||||
import io;
|
||||
export fn main() i32 = {
|
||||
let sinkbuf: [16]u8;
|
||||
let sink: memio.stream = memio.fixed(sinkbuf[0:16]);
|
||||
let sinkvs: io.stream = &sink.vt;
|
||||
let rb: [4]u8;
|
||||
let wb: [8]u8;
|
||||
let b: bufio.stream = bufio.init(sinkvs, rb[0:4], wb[0:8]);
|
||||
let bvs: io.stream = &b.vt;
|
||||
let semi: [1]u8;
|
||||
semi[0] = 59u8;
|
||||
bufio.setflush(&b, semi[0:1]);
|
||||
let payload: [3]u8;
|
||||
payload[0]=97u8; payload[1]=98u8; payload[2]=59u8;
|
||||
let wr = io.write(bvs, payload[0:3]);
|
||||
if (!(wr is size)) { return 81; };
|
||||
if (sink.pos != 3) { return 82; };
|
||||
if (sinkbuf[0] != 97u8 || sinkbuf[2] != 59u8) { return 83; };
|
||||
return 54;
|
||||
};
|
||||
Reference in New Issue
Block a user