mirror of
https://github.com/nodejs/node.git
synced 2024-11-24 03:07:54 +01:00
96058f33a9
This test provides missing coverage for __wasi_fd_renumber(). PR-URL: https://github.com/nodejs/node/pull/31432 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
17 lines
377 B
C
17 lines
377 B
C
#include <assert.h>
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
FILE* file_orig = fopen("/sandbox/input.txt", "r");
|
|
assert(file_orig != NULL);
|
|
FILE* file_new = freopen("/sandbox/input2.txt", "r", file_orig);
|
|
assert(file_new != NULL);
|
|
|
|
int c = fgetc(file_new);
|
|
while (c != EOF) {
|
|
int wrote = fputc((char)c, stdout);
|
|
assert(wrote != EOF);
|
|
c = fgetc(file_new);
|
|
}
|
|
}
|