Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebodin committed Oct 6, 2023
1 parent a8190b3 commit 31dc236
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_logs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ function test_direct_log_error()
return nothing
end

function test_direct_log_fatal_error()
log_error_path = "error.log"
polyglot_logger = LoggingPolyglot.create_polyglot_logger(log_error_path)
@test_throws ErrorException LoggingPolyglot.fatal_error("test message")
LoggingPolyglot.close_polyglot_logger(polyglot_logger)
rm(log_error_path; force = true)
return nothing
end

function test_direct_log_fatal_error_other_exception()
log_error_path = "error.log"
polyglot_logger = LoggingPolyglot.create_polyglot_logger(log_error_path)
@test_throws DimensionMismatch LoggingPolyglot.fatal_error("dim mismatch"; exception = DimensionMismatch(""))
LoggingPolyglot.close_polyglot_logger(polyglot_logger)
rm(log_error_path; force = true)
return nothing
end

function test_different_logs_same_file()
log_path = "test.log"
polyglot_logger = LoggingPolyglot.create_polyglot_logger(log_path)
Expand Down

0 comments on commit 31dc236

Please sign in to comment.