Skip to content

Commit

Permalink
Remove 'if false' dead code blocks, use test_broken
Browse files Browse the repository at this point in the history
for the ones in test/spawn.jl
  • Loading branch information
tkelman committed Jul 2, 2016
1 parent 5000628 commit 373db0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
9 changes: 0 additions & 9 deletions base/coreimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
Main.Core.eval(Main.Core, :(baremodule Inference
using Core.Intrinsics
import Core: print, println, show, write, unsafe_write, STDOUT, STDERR
if false # show that the IO system is already (relatively) operational
print("HELLO")
println(" WORLD")
show("αβγ :)"); println()
println(STDERR, "TEST")
println(STDERR, STDERR)
println(STDERR, 'a')
println(STDERR, 'α')
end

ccall(:jl_set_istopmod, Void, (Bool,), false)

Expand Down
10 changes: 0 additions & 10 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ if false
show(io::IO, x::ANY) = Core.show(io, x)
print(io::IO, a::ANY...) = Core.print(io, a...)
println(io::IO, x::ANY...) = Core.println(io, x...)
if false # show that the IO system now (relatively) operational
print("HELLO")
println(" WORLD")
show("αβγ :)"); println()
println(STDERR, "TEST")
println(STDERR, STDERR)
println(STDERR, 'a')
println(STDERR, 'α')
show(STDOUT, 'α')
end
end

## Load essential files and libraries
Expand Down
22 changes: 9 additions & 13 deletions test/spawn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,22 @@ if valgrind_off
@test_throws Base.UVError run(`foo_is_not_a_valid_command`)
end

if false
prefixer(prefix, sleep) = `perl -nle '$|=1; print "'$prefix' ", $_; sleep '$sleep';'`
@test success(pipeline(`perl -le '$|=1; for(0..2){ print; sleep 1 }'`,
prefixer(prefix, sleep) = `perl -nle '$|=1; print "'$prefix' ", $_; sleep '$sleep';'`
@test success(pipeline(`perl -le '$|=1; for(0..2){ print; sleep 1 }'`,
prefixer("A",2) & prefixer("B",2)))
@test success(pipeline(`perl -le '$|=1; for(0..2){ print; sleep 1 }'`,
@test success(pipeline(`perl -le '$|=1; for(0..2){ print; sleep 1 }'`,
prefixer("X",3) & prefixer("Y",3) & prefixer("Z",3),
prefixer("A",2) & prefixer("B",2)))
end

@test success(`true`)
@test !success(`false`)
@test success(pipeline(`true`, `true`))
if false
@test success(ignorestatus(`false`))
@test success(pipeline(ignorestatus(`false`), `true`))
@test !success(pipeline(ignorestatus(`false`), `false`))
@test !success(ignorestatus(`false`) & `false`)
@test success(ignorestatus(pipeline(`false`, `false`)))
@test success(ignorestatus(`false` & `false`))
end
@test_broken success(ignorestatus(`false`))
@test_broken success(pipeline(ignorestatus(`false`), `true`))
@test !success(pipeline(ignorestatus(`false`), `false`))
@test !success(ignorestatus(`false`) & `false`)
@test_broken success(ignorestatus(pipeline(`false`, `false`)))
@test_broken success(ignorestatus(`false` & `false`))

# STDIN Redirection
file = tempname()
Expand Down

0 comments on commit 373db0f

Please sign in to comment.