summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/testdata/binary_stdio.js
blob: aa370a933cc263064e2bfdb9bec2011c7063cfa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
const buffer = new Uint8Array(10);
const nread = await Deno.stdin.read(buffer);

if (nread != 10) {
  throw new Error("Too little data read");
}

const nwritten = await Deno.stdout.write(buffer);
if (nwritten != 10) {
  throw new Error("Too little data written");
}