Skip to content

Commit

Permalink
Merge pull request #165 from jebej/fix-printing-test
Browse files Browse the repository at this point in the history
fix failing tests
  • Loading branch information
hustf authored Dec 12, 2020
2 parents 0b82586 + 1489e22 commit a47f2ab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ os:
- linux
- osx
julia:
- 0.7
- 1.0
- 1
sudo: false
notifications:
email: false
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
environment:
matrix:
- julia_version: 0.7
- julia_version: 1.0
- julia_version: 1
- julia_version: nightly

Expand All @@ -12,7 +12,7 @@ platform:
# # (tests will run but not make your overall status red)
matrix:
allow_failures:
- julia_version: latest
- julia_version: nightly

branches:
only:
Expand Down
4 changes: 4 additions & 0 deletions src/Logger/websocketlogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import Base.CoreLogging: logmsg_code,
_min_enabled_level,
current_logger_for_env,
logging_error
if VERSION >= v"1.1"
import Base.CoreLogging: _invoked_shouldlog
end

import Base.string_with_env
const Wslog = LogLevel(50)
"""
Expand Down
16 changes: 8 additions & 8 deletions test/test_websocketlogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,37 +202,37 @@ import Base.CoreLogging: Info,
│ exception =
│ DivideError: integer division error
│ Stacktrace:
│ [1] func1() at""")
$(VERSION < v"1.6" ? "" : " ")[1] func1()""")


@testset "Limiting large data structures" begin
@test genmsg("msg", a=fill(1.00001, 100,100), b=fill(2.00002, 10,10)) ==
replace("""
"""
┌ PREFIX msg
│ a =
│ 100×100 Array{Float64,2}:
│ 100×100 $(Matrix{Float64}):
│ 1.00001 1.00001 1.00001 1.00001 … 1.00001 1.00001 1.00001
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
│ ⋮ ⋱ EOL
│ ⋮ ⋱ $(VERSION < v"1.1" ? " " : "")
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
│ b =
│ 10×10 Array{Float64,2}:
│ 10×10 $(Matrix{Float64}):
│ 2.00002 2.00002 2.00002 2.00002 … 2.00002 2.00002 2.00002
│ 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002
│ 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002
│ ⋮ ⋱ EOL
│ ⋮ ⋱ $(VERSION < v"1.1" ? " " : "")
│ 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002
│ 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002 2.00002
└ SUFFIX
""", "EOL"=>"") # EOL hack to work around git whitespace errors
"""
# Limiting the amount which is printed
@test genmsg("msg", a=fill(1.00001, 10,10), show_limited=false) ==
"""
┌ PREFIX msg
│ a =
│ 10×10 Array{Float64,2}:
│ 10×10 $(Matrix{Float64}):
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
│ 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001 1.00001
Expand Down

0 comments on commit a47f2ab

Please sign in to comment.