Skip to content

Commit eabe1f8

Browse files
committed
use iobuffer for print_tree test
1 parent 57c4895 commit eabe1f8

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/print_tree.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
21
using ModelingToolkit, AbstractTrees, Test
32

43
include("components.jl")
54

6-
open("rc_tree.txt", "w") do io
7-
print_tree(io, rc_model)
8-
end;
9-
5+
io = IOBuffer()
6+
print_tree(io, rc_model)
7+
ser = String(take!(io))
108
str =
119
"""rc_model
1210
├─ resistor
@@ -21,6 +19,4 @@ str =
2119
└─ ground
2220
└─ g
2321
"""
24-
@test read("rc_tree.txt", String) == str
25-
26-
rm("rc_tree.txt")
22+
@test ser == strip(str)

0 commit comments

Comments
 (0)