Skip to content

Commit

Permalink
Fix MCode Serialization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Dec 10, 2024
1 parent 5e2b968 commit adc5f20
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Hedgehog hiding (Rec, Test, test)
import Hedgehog.Gen qualified as Gen
import Hedgehog.Range qualified as Range
import Unison.Prelude
import Unison.Runtime.Foreign.Function.Type (ForeignFunc)
import Unison.Runtime.Interface
import Unison.Runtime.MCode (Args (..), BPrim1, BPrim2, Branch, Comb, CombIx (..), GBranch (..), GComb (..), GCombInfo (..), GInstr (..), GRef (..), GSection (..), Instr, MLit (..), Ref, Section, UPrim1, UPrim2)
import Unison.Runtime.Machine (Combs)
Expand All @@ -33,6 +34,9 @@ test =
]
EasyTest.expect success

genForeignCall :: Gen ForeignFunc
genForeignCall = Gen.enumBounded

genEnumMap :: (EC.EnumKey k) => Gen k -> Gen v -> Gen (EnumMap k v)
genEnumMap genK genV = EC.mapFromList <$> Gen.list (Range.linear 0 10) ((,) <$> genK <*> genV)

Expand Down Expand Up @@ -116,7 +120,7 @@ genInstr =
UPrim2 <$> genUPrim2 <*> genSmallInt <*> genSmallInt,
BPrim1 <$> genBPrim1 <*> genSmallInt,
BPrim2 <$> genBPrim2 <*> genSmallInt <*> genSmallInt,
ForeignCall <$> Gen.bool <*> genSmallWord64 <*> genArgs,
ForeignCall <$> Gen.bool <*> genForeignCall <*> genArgs,
SetDyn <$> genSmallWord64 <*> genSmallInt,
Capture <$> genSmallWord64,
Name <$> genGRef <*> genArgs,
Expand Down

0 comments on commit adc5f20

Please sign in to comment.