mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
1e0808d501
Currently sync operations on stdin are failing because tokio::Stdin cannot be converted to a std::File. This commit replaces tokio::stdin with a raw file descriptor wrapped in a std::fs::File which can be converted to a tokio::File and back again making the synchronous version of op_read actually work.
32 lines
952 B
TypeScript
32 lines
952 B
TypeScript
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
import { unitTest, assertEquals } from "./test_util.ts";
|
|
|
|
unitTest(async function stdioStdinRead() {
|
|
const nread = await Deno.stdin.read(new Uint8Array(0));
|
|
assertEquals(nread, 0);
|
|
});
|
|
|
|
unitTest(function stdioStdinReadSync() {
|
|
const nread = Deno.stdin.readSync(new Uint8Array(0));
|
|
assertEquals(nread, 0);
|
|
});
|
|
|
|
unitTest(async function stdioStdoutWrite() {
|
|
const nwritten = await Deno.stdout.write(new Uint8Array(0));
|
|
assertEquals(nwritten, 0);
|
|
});
|
|
|
|
unitTest(function stdioStdoutWriteSync() {
|
|
const nwritten = Deno.stdout.writeSync(new Uint8Array(0));
|
|
assertEquals(nwritten, 0);
|
|
});
|
|
|
|
unitTest(async function stdioStderrWrite() {
|
|
const nwritten = await Deno.stderr.write(new Uint8Array(0));
|
|
assertEquals(nwritten, 0);
|
|
});
|
|
|
|
unitTest(function stdioStderrWriteSync() {
|
|
const nwritten = Deno.stderr.writeSync(new Uint8Array(0));
|
|
assertEquals(nwritten, 0);
|
|
});
|