Skip to content

Commit

Permalink
Add goldenPir tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
thealmarty committed May 1, 2023
1 parent beabba5 commit 2e41ccb
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plutus-tx-plugin/test/Optimization/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import PlutusCore.Test
import PlutusTx.Builtins qualified as PlutusTx
import PlutusTx.Code
import PlutusTx.Prelude qualified as P
import PlutusTx.Test ()
import PlutusTx.Test (goldenPir)
import PlutusTx.TH (compile)

-- These are tests that run with the simplifier on, and run all the way to UPLC.
Expand All @@ -27,8 +27,10 @@ tests :: TestNested
tests = testNested "Optimization" [
goldenUPlc "maybeFun" maybeFun
, goldenUPlc "trueOrError" trueOrError
, goldenPir "trueOrErrorPir" trueOrError
, goldenUEval "trueOrErrorEval" [ toUPlc trueOrError ]
, goldenUPlc "trueOrErrorOpaque" trueOrErrorOpaque
, goldenPir "trueOrErrorOpaquePir" trueOrErrorOpaque
, goldenUEval "trueOrErrorOpaqueEval" [ toUPlc trueOrErrorOpaque ]
]

Expand Down
19 changes: 19 additions & 0 deletions plutus-tx-plugin/test/Optimization/trueOrErrorOpaquePir.plc.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
(program
1.1.0
(let
(nonrec)
(datatypebind
(datatype
(tyvardecl Bool (type))

Bool_match
(vardecl True Bool) (vardecl False Bool)
)
)
(datatypebind
(datatype (tyvardecl Unit (type)) Unit_match (vardecl Unit Unit))
)
(termbind (strict) (vardecl ds Bool) (error Bool))
True
)
)
15 changes: 15 additions & 0 deletions plutus-tx-plugin/test/Optimization/trueOrErrorPir.plc.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(program
1.1.0
(let
(nonrec)
(datatypebind
(datatype
(tyvardecl Bool (type))

Bool_match
(vardecl True Bool) (vardecl False Bool)
)
)
True
)
)

0 comments on commit 2e41ccb

Please sign in to comment.