Skip to content

Commit b3fedd0

Browse files
committed
Added small test for coverage
1 parent fff32af commit b3fedd0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/auxiliary/test_logs.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,33 @@ end
465465
@test occursin("symbols", msg)
466466
@test occursin("[a, b, c, d]", msg)
467467
end
468+
469+
@testitem "msg_fields*" begin
470+
struct MyTestObject
471+
integer::Int
472+
float::Float64
473+
string::String
474+
vector::Vector{Float64}
475+
end
476+
477+
data = MyTestObject(42, 3.14159, "hello", [1.0, 2.0, 3.0])
478+
479+
msg = Peridynamics.msg_fields(data)
480+
@test occursin("integer", msg)
481+
@test occursin("42", msg)
482+
@test occursin("float", msg)
483+
@test occursin("3.14159", msg)
484+
@test occursin("string", msg)
485+
@test occursin("hello", msg)
486+
@test occursin("vector", msg)
487+
@test occursin("[1.0, 2.0, 3.0]", msg)
488+
489+
msg_inline = Peridynamics.msg_fields_inline(data)
490+
@test occursin("integer=42", msg_inline)
491+
@test occursin("float=3.14159", msg_inline)
492+
@test occursin("string=hello", msg_inline)
493+
@test occursin("vector=[1.0, 2.0, 3.0]", msg_inline)
494+
495+
msg_brackets = Peridynamics.msg_fields_in_brackets(data)
496+
@test msg_brackets == "(" * msg_inline * ")"
497+
end

0 commit comments

Comments
 (0)