Skip to content

Commit 61d0fcd

Browse files
authored
test: add some latex tests (#5)
1 parent fd7ee70 commit 61d0fcd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/display.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function latex(term::Term; advanced::Bool=true)
248248
result *= "e^{im_1\\omega t}"
249249
end
250250

251-
return result
251+
return latexstring(result)
252252
end
253253

254254
"""

test/display.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,22 @@ Tests for LaTeX generation and display functionality.
99
latex_str = latex(term; advanced=false) # Use simple format for this test
1010
@test isa(latex_str, LaTeXString)
1111
@test occursin("2*1", latex_str)
12+
13+
latex_str = latex(term; advanced=true)
14+
@test isa(latex_str, LaTeXString)
15+
@test occursin("H_{m_1}", latex_str)
1216
end
1317

1418
@testset "Terms Collection LaTeX" begin
1519
terms = Terms([Term(rotating=0), Term(rotating=1)])
1620
latex_str = latex(terms; advanced=false) # Use simple format for this test
1721
@test isa(latex_str, LaTeXString)
22+
@test occursin("1*0", latex_str)
23+
@test occursin("1*1", latex_str)
24+
25+
latex_str = latex(terms; advanced=true)
26+
@test isa(latex_str, LaTeXString)
27+
@test occursin("H_0", latex_str)
28+
@test occursin("H_{m_1}", latex_str)
1829
end
1930
end

0 commit comments

Comments
 (0)