Skip to content

Commit 30c6aaf

Browse files
committed
make sure flushing behaviour is correct for standard stream tests
1 parent f42750e commit 30c6aaf

File tree

1 file changed

+4
-4
lines changed
  • graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/module

1 file changed

+4
-4
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/module/PosixTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,22 @@ public void close() throws IOException {
153153

154154
@Test
155155
public void stdout() {
156-
assertPrints("hello", "import sys; sys.stdout.write('hello')");
156+
assertPrints("hello\n", "import sys; sys.stdout.write('hello\\n')");
157157
}
158158

159159
@Test
160160
public void stderr() {
161-
assertLastLineError("error", "import sys; sys.stderr.write('error')");
161+
assertLastLineError("error\n", "import sys; sys.stderr.write('error\\n')");
162162
}
163163

164164
@Test
165165
public void printToStdout() {
166-
assertPrints("1-2...", "import sys; print('1', '2', sep='-', file=sys.stdout, end='...')");
166+
assertPrints("1-2...", "import sys; print('1', '2', sep='-', file=sys.stdout, end='...', flush=True)");
167167
}
168168

169169
@Test
170170
public void printToStderr() {
171-
assertLastLineError("1-2...", "import sys; print('1', '2', sep='-', file=sys.stderr, end='...')");
171+
assertLastLineError("1-2...", "import sys; print('1', '2', sep='-', file=sys.stderr, end='...', flush=True)");
172172
}
173173

174174
@Test

0 commit comments

Comments
 (0)