~sircmpwn/hare-compress

8cd9e9d02718170a38b5d639186f70e03a9986ed — Pierre Curto 1 year, 10 months ago 159eb2b
compress/zlib: update gen program for test data

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
1 files changed, 6 insertions(+), 8 deletions(-)

M compress/zlib/.testdata/gen.ha
M compress/zlib/.testdata/gen.ha => compress/zlib/.testdata/gen.ha +6 -8
@@ 31,18 31,16 @@ export fn main() void = {
		const in = os::open(vectors[i].0)!;
		defer io::close(in)!;
		const ins = bufio::dynamic(io::mode::WRITE);
		io::copy(ins, in)!;
		const inb = bufio::finish(ins);
		defer free(inb);
		write(vectors[i].0, inb);
		io::copy(&ins, in)!;
		defer io::close(&ins)!;
		write(vectors[i].0, bufio::buffer(&ins));

		const out = os::open(vectors[i].1)!;
		defer io::close(out)!;
		const outs = bufio::dynamic(io::mode::WRITE);
		io::copy(outs, out)!;
		const outb = bufio::finish(ins);
		defer free(outb);
		write(vectors[i].1, outb);
		io::copy(&outs, out)!;
		defer io::close(&outs)!;
		write(vectors[i].1, bufio::buffer(&outs));
	};

	fmt::printfln("const vectors: [_](*[]u8, *[]u8) = [")!;