Skip to content

Commit

Permalink
Add docs to integration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ana Pantilie <ana.pantilie95@gmail.com>
  • Loading branch information
ana-pantilie committed May 8, 2024
1 parent 7d96dc4 commit 2862dec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plutus-tx-plugin/test/AssocMap/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ propertyTests =
, testProperty "builtinDataEncoding" builtinDataEncodingSpec
]

-- | Test the performance and interaction between 'insert', 'delete' and 'lookup'.
map1 ::
CompiledCode
( Integer ->
Expand Down Expand Up @@ -106,6 +107,9 @@ map1 =
||]
)

-- | Test that 'unionWith' is implemented correctly. Due to the nature of 'Map k v',
-- some type errors are only caught when running the PlutusTx compiler on code which uses
-- 'unionWith'.
map2 :: CompiledCode (Integer -> [(Integer, PlutusTx.BuiltinString)])
map2 =
$$( compile
Expand All @@ -131,6 +135,8 @@ map2 =
||]
)

-- | Similar to map2, but uses 'union' instead of 'unionWith'. Evaluating 'map3' and 'map2'
-- should yield the same result.
map3 :: CompiledCode (Integer -> [(Integer, PlutusTx.BuiltinString)])
map3 =
$$( compile
Expand Down

0 comments on commit 2862dec

Please sign in to comment.