Skip to content

Commit 2260c0b

Browse files
committed
Simplify reading of some buffers in tests
1 parent 2c14fec commit 2260c0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/runners.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ end
6565
@test run(ur, `/bin/bash -c "echo test"`, iobuff)
6666
seek(iobuff, 0)
6767
# Test that we get the output we expect (e.g. the second line is `test`)
68-
@test split(String(read(iobuff)), "\n")[2] == "test"
68+
@test readlines(iobuff)[2] == "test"
6969
end
7070
end
7171

@@ -259,7 +259,7 @@ end
259259
iobuff = IOBuffer()
260260
@test !run(ur, cmd, iobuff; tee_stream=devnull)
261261
seekstart(iobuff)
262-
@test split(String(read(iobuff)), "\n")[2] == "Cannot force an architecture"
262+
@test readlines(iobuff)[2] == "Cannot force an architecture"
263263

264264
ur = preferred_runner()(dir; platform=platform, lock_microarchitecture=false)
265265
iobuff = IOBuffer()
@@ -277,7 +277,7 @@ end
277277
iobuff = IOBuffer()
278278
@test !run(ur, cmd, iobuff; tee_stream=devnull)
279279
seekstart(iobuff)
280-
lines = split(String(read(iobuff)), "\n")
280+
lines = readlines(iobuff)
281281
@test lines[2] == "You used one or more of the unsafe flags: -Ofast, -ffast-math, -funsafe-math-optimizations"
282282
@test lines[3] == "Please repent."
283283

0 commit comments

Comments
 (0)