Skip to content

Commit

Permalink
Merge pull request #36 from AlgebraicJulia/llm/testshow
Browse files Browse the repository at this point in the history
Test UWD show
  • Loading branch information
lukem12345 authored Feb 2, 2024
2 parents 849b244 + c923919 commit 4233ccd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/uwd_examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ mexpr′ = readback(mexpr)
# @test mexpr == mexpr′
end

@testset "UWD show" begin
@test sprint(show, u) ==
"{ R(x:X, y:Y)\n S(y:Y, z:Z)\n T(z:Z, y:Y, u) } where {x:X, z:Z}"
@test sprint(show, JSON3.read(JSON3.write(u), UWDTerm)) ==
"{ R(x:X, y:Y)\n S(y:Y, z:Z)\n T(z:Z, y:Y, u) } where {x:X, z:Z}"
@test sprint(show, mexpr) ==
"\"\"\"\nASKE Model Representation: rst_relationv0.1 :: UWDExpr \n modelreps.io/UWD\n\nA demo UWD showing generic relation composition\n\"\"\"\nUWD:\n{ R(x:X, y:Y)\n S(y:Y, z:Z)\n T(z:Z, y:Y, u) } where {x:X, z:Z}"
end

to_graphviz(uwd, box_labels=:name, junction_labels=:variable)

display(uwd)
display(uwd)

0 comments on commit 4233ccd

Please sign in to comment.