Skip to content

Commit

Permalink
Only check number of lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lkastner committed Apr 10, 2024
1 parent f444a50 commit 8e4f142
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
11 changes: 8 additions & 3 deletions test/utils/Banners/banners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,32 @@ function run_repl_code(code::String, proj::String)
return result, err
end

_nlines(s::String) = countlines(IOBuffer(s))


# Syntax won't work for version 1.6
# If display width is too small, Oscar banner will only be one line
if VERSION>=v"1.9"
@testset "Banners" begin
proj = create_test_prog()
run_repl_code("import Pkg; Pkg.resolve();", proj)
oscar_banner, err = run_repl_code("using Oscar", proj)
path = joinpath(Oscar.oscardir, "test/utils/Banners")
res1 = @test oscar_banner == load(joinpath(path, "oscar_banner.txt")) broken=VERSION>=v"1.11.0-DEV"
res1 = @test _nlines(oscar_banner) in [1,5] broken=VERSION>=v"1.11.0-DEV"
if res1 isa Test.Fail
println("OB")
println(oscar_banner)
println(err)
end
chain_banner, err = run_repl_code("using Oscar; using Polymake;", proj)
res2 = @test chain_banner == load(joinpath(path, "oscar_banner.txt")) broken=VERSION>=v"1.11.0-DEV"
res2 = @test _nlines(chain_banner) in [1,5] broken=VERSION>=v"1.11.0-DEV"
if res2 isa Test.Fail
println("CB")
println(oscar_banner)
println(err)
end
polymake_banner, err = run_repl_code("using Polymake", proj)
res3 = @test polymake_banner == load(joinpath(path, "polymake_banner.txt")) broken=VERSION>=v"1.11.0-DEV"
res3 = @test _nlines(polymake_banner) == 9 broken=VERSION>=v"1.11.0-DEV"
if res3 isa Test.Fail
println("PB")
println(polymake_banner)
Expand Down
1 change: 0 additions & 1 deletion test/utils/Banners/oscar_banner.json

This file was deleted.

1 change: 0 additions & 1 deletion test/utils/Banners/polymake_banner.json

This file was deleted.

0 comments on commit 8e4f142

Please sign in to comment.