Skip to content

Commit

Permalink
Use Readable UPLC in the golden files of simplifier tests (#5626)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 authored Nov 12, 2023
1 parent 6a343d6 commit 9084737
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 51 deletions.
2 changes: 1 addition & 1 deletion plutus-core/untyped-plutus-core/test/Transform/Simplify.hs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ goldenVsPretty :: (PrettyPlc a) => String -> String -> a -> TestTree
goldenVsPretty extn name value =
goldenVsString name ("untyped-plutus-core/test/Transform/" ++ name ++ extn) $
pure . BSL.fromStrict . encodeUtf8 . render $
prettyPlcClassicDebug value
prettyPlcReadableDebug value

goldenVsSimplified :: String -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree
goldenVsSimplified name =
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(con integer 1)
1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(con integer 1)
1
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
[
(lam
a_5
[
[ f_1 [ [ g_2 (con integer 1) ] (con integer 0) ] ]
[ a_5 (con integer 2) ]
]
)
(lam x_6 (lam y_7 [ [ g_2 y_7 ] x_6 ]))
]
((\a_5 -> f_1 (g_2 1 0) (a_5 2)) (\x_6 y_7 -> g_2 y_7 x_6))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ [ [ (force (builtin ifThenElse)) b_0 ] (con integer 1) ] (con integer 2) ]
(force ifThenElse b_0 1 2)
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
(case
[ [ [ (force (builtin ifThenElse)) b_0 ] t_1 ] (constr 1) ]
(con integer 1)
(con integer 2)
)
(case (force ifThenElse b_0 t_1 (constr 1 [])) [1, 2])
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
[ [ (force (builtin ifThenElse)) b_0 ] [ [ f_3 x_1 ] xs_2 ] ] (con integer 2)
]
(force ifThenElse b_0 (f_3 x_1 xs_2) 2)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(delay (con integer 1))
(delay 1)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ (lam a_1 [ [ (builtin addInteger) a_1 ] a_1 ]) (con integer 1) ]
((\a_1 -> addInteger a_1 a_1) 1)
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
[
(lam a_1 [ [ (builtin addInteger) (force a_1) ] (force a_1) ])
(delay [ [ (builtin addInteger) (con integer 1) ] (con integer 2) ])
]
((\a_1 -> addInteger (force a_1) (force a_1)) (delay (addInteger 1 2)))
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
[
(lam a_2 [ [ (builtin addInteger) (force a_2) ] (force a_2) ])
(delay (con integer 1))
]
((\a_2 -> addInteger (force a_2) (force a_2)) (delay 1))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ (lam a_2 (lam b_3 a_2)) (error) ]
((\a_2 b_3 -> a_2) error)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ (lam a_2 (lam b_3 a_2)) (error) ]
((\a_2 b_3 -> a_2) error)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ (lam a_2 (lam b_3 a_2)) (error) ]
((\a_2 b_3 -> a_2) error)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ (lam a_3 (lam b_4 a_3)) (force a_2) ]
((\a_3 b_4 -> a_3) (force a_2))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(lam b_4 a_2)
(\b_4 -> a_2)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(lam b_4 a_2)
(\b_4 -> a_2)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(lam b_5 [ (lam x_8 (lam y_9 [ (con integer 1) x_8 ])) (con integer 1) ])
(\b_5 -> (\x_8 y_9 -> 1 x_8) 1)
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
[
(lam a_4 (lam b_5 a_4))
(force
[
(lam x_6 (delay (lam y_7 [ x_6 x_6 ])))
(delay [ (error) (con integer 1) ])
]
)
]
((\a_4 b_5 -> a_4)
(force ((\x_6 -> delay (\y_7 -> x_6 x_6)) (delay (error 1)))))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(force [ (lam a_1 (delay [ (con integer 1) a_1 ])) (con integer 1) ])
(force ((\a_1 -> delay (1 a_1)) 1))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ [ (con integer 3) (con integer 1) ] (con integer 2) ]
(3 1 2)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(con integer 1)
1

0 comments on commit 9084737

Please sign in to comment.