-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add recordFieldsManual test * Use field accessors repeatedly * 9.6
- Loading branch information
Showing
28 changed files
with
1,144 additions
and
132 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
plutus-tx-plugin/test/AsData/Budget/9.2/onlyUseFirstField.uplc.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
program | ||
1.1.0 | ||
(\d -> | ||
(\tup -> | ||
force | ||
(force ifThenElse | ||
(equalsInteger 0 (force (force fstPair) tup)) | ||
(delay | ||
((\l -> | ||
(\l -> | ||
(\l -> | ||
(\ds -> | ||
(\ds -> | ||
(\ds -> unIData (force headList l)) | ||
(unIData (force headList (force tailList l)))) | ||
(unIData (force headList l))) | ||
(unIData (force headList l))) | ||
(force tailList l)) | ||
(force tailList l)) | ||
(force (force sndPair) tup))) | ||
(delay error))) | ||
(unConstrData d)) |
4 changes: 2 additions & 2 deletions
4
plutus-tx-plugin/test/AsData/Budget/9.2/patternMatching-budget.eval.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 4752053 | ||
| mem: 14356}) | ||
({cpu: 55946147 | ||
| mem: 167776}) |
2 changes: 1 addition & 1 deletion
2
plutus-tx-plugin/test/AsData/Budget/9.2/patternMatching.eval.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(con integer 100) | ||
(con integer 220) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
plutus-tx-plugin/test/AsData/Budget/9.2/patternMatching.uplc.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
program | ||
1.1.0 | ||
(\d -> | ||
(\ds -> | ||
(\ds -> | ||
(\x -> | ||
(\y -> | ||
(\z -> | ||
(\w -> | ||
(\lessThanInteger -> | ||
(\addInteger -> | ||
addInteger | ||
(addInteger | ||
(addInteger | ||
(addInteger | ||
(addInteger (force x) (force y)) | ||
(force z)) | ||
(force w)) | ||
(force | ||
(case | ||
(lessThanInteger | ||
(addInteger (force y) (force z)) | ||
(addInteger (force x) (force w))) | ||
[ (delay | ||
(addInteger (force x) (force z))) | ||
, (delay | ||
(addInteger | ||
(force y) | ||
(force w))) ]))) | ||
(force | ||
(case | ||
(lessThanInteger | ||
(addInteger (force z) (force y)) | ||
(addInteger (force w) (force x))) | ||
[ (delay (addInteger (force z) (force x))) | ||
, (delay | ||
(addInteger (force w) (force y))) ]))) | ||
(\x y -> addInteger x y)) | ||
(\x y -> | ||
force ifThenElse | ||
(lessThanInteger x y) | ||
(constr 0 []) | ||
(constr 1 []))) | ||
(delay (case (force ds) [(\x y z w -> w)]))) | ||
(delay (case (force ds) [(\x y z w -> z)]))) | ||
(delay (case (force ds) [(\x y z w -> y)]))) | ||
(delay (case (force ds) [(\x y z w -> x)]))) | ||
(force ds)) | ||
(delay | ||
((\tup -> | ||
force | ||
(force ifThenElse | ||
(equalsInteger 0 (force (force fstPair) tup)) | ||
(delay | ||
((\l -> | ||
(\l -> | ||
(\l -> | ||
(\z w -> | ||
constr 0 | ||
[ (unIData (force headList l)) | ||
, (unIData (force headList l)) | ||
, z | ||
, w ]) | ||
(unIData (force headList l)) | ||
(unIData (force headList (force tailList l)))) | ||
(force tailList l)) | ||
(force tailList l)) | ||
(force (force sndPair) tup))) | ||
(delay error))) | ||
(unConstrData d)))) |
2 changes: 2 additions & 0 deletions
2
plutus-tx-plugin/test/AsData/Budget/9.2/recordFields-budget-manual.eval.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
({cpu: 23015765 | ||
| mem: 62058}) |
4 changes: 2 additions & 2 deletions
4
plutus-tx-plugin/test/AsData/Budget/9.2/recordFields-budget.eval.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 12986619 | ||
| mem: 39006}) | ||
({cpu: 36195493 | ||
| mem: 107926}) |
1 change: 1 addition & 0 deletions
1
plutus-tx-plugin/test/AsData/Budget/9.2/recordFields-manual.eval.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(con integer 220) |
101 changes: 101 additions & 0 deletions
101
plutus-tx-plugin/test/AsData/Budget/9.2/recordFields-manual.pir.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
let | ||
!addInteger : integer -> integer -> integer | ||
= \(x : integer) (y : integer) -> addInteger x y | ||
!int1Manual : data -> integer | ||
= \(ds : data) -> | ||
let | ||
!tup : pair integer (list data) = unConstrData ds | ||
!i : integer = fstPair {integer} {list data} tup | ||
!d : data = headList {data} (sndPair {integer} {list data} tup) | ||
in | ||
ifThenElse | ||
{all dead. integer} | ||
(equalsInteger 0 i) | ||
(/\dead -> unIData d) | ||
(/\dead -> error {integer}) | ||
{all dead. dead} | ||
!int2Manual : data -> integer | ||
= \(ds : data) -> | ||
let | ||
!tup : pair integer (list data) = unConstrData ds | ||
!i : integer = fstPair {integer} {list data} tup | ||
!d : data | ||
= headList | ||
{data} | ||
(tailList {data} (sndPair {integer} {list data} tup)) | ||
in | ||
ifThenElse | ||
{all dead. integer} | ||
(equalsInteger 0 i) | ||
(/\dead -> unIData d) | ||
(/\dead -> error {integer}) | ||
{all dead. dead} | ||
!int3Manual : data -> integer | ||
= \(ds : data) -> | ||
let | ||
!tup : pair integer (list data) = unConstrData ds | ||
!i : integer = fstPair {integer} {list data} tup | ||
!d : data | ||
= headList | ||
{data} | ||
(tailList | ||
{data} | ||
(tailList {data} (sndPair {integer} {list data} tup))) | ||
in | ||
ifThenElse | ||
{all dead. integer} | ||
(equalsInteger 0 i) | ||
(/\dead -> unIData d) | ||
(/\dead -> error {integer}) | ||
{all dead. dead} | ||
!int4Manual : data -> integer | ||
= \(ds : data) -> | ||
let | ||
!tup : pair integer (list data) = unConstrData ds | ||
!i : integer = fstPair {integer} {list data} tup | ||
!d : data | ||
= headList | ||
{data} | ||
(tailList | ||
{data} | ||
(tailList | ||
{data} | ||
(tailList {data} (sndPair {integer} {list data} tup)))) | ||
in | ||
ifThenElse | ||
{all dead. integer} | ||
(equalsInteger 0 i) | ||
(/\dead -> unIData d) | ||
(/\dead -> error {integer}) | ||
{all dead. dead} | ||
data Bool | Bool_match where | ||
True : Bool | ||
False : Bool | ||
!lessThanInteger : integer -> integer -> Bool | ||
= \(x : integer) (y : integer) -> | ||
ifThenElse {Bool} (lessThanInteger x y) True False | ||
in | ||
\(d : data) -> | ||
let | ||
!x : integer = int1Manual d | ||
!y : integer = int2Manual d | ||
!z : integer = int3Manual d | ||
!w : integer = int4Manual d | ||
in | ||
addInteger | ||
(addInteger | ||
(addInteger (addInteger (addInteger x y) z) w) | ||
(Bool_match | ||
(lessThanInteger (addInteger y z) (addInteger x w)) | ||
{all dead. integer} | ||
(/\dead -> addInteger x z) | ||
(/\dead -> addInteger y w) | ||
{all dead. dead})) | ||
(Bool_match | ||
(lessThanInteger | ||
(addInteger (int3Manual d) (int2Manual d)) | ||
(addInteger (int4Manual d) (int1Manual d))) | ||
{all dead. integer} | ||
(/\dead -> addInteger (int3Manual d) (int1Manual d)) | ||
(/\dead -> addInteger (int4Manual d) (int2Manual d)) | ||
{all dead. dead}) |
Oops, something went wrong.