cleveland-0.1.0: test/TestSuite/Cleveland/Entrypoints.hs
-- SPDX-FileCopyrightText: 2021 Tocqueville Group
--
-- SPDX-License-Identifier: LicenseRef-MIT-TQ
module TestSuite.Cleveland.Entrypoints
( test_duplicateEntrypoints
) where
import Test.Tasty.Runners
import Morley.Michelson.Untyped
import Test.Cleveland.Michelson.Entrypoints
import TestSuite.Cleveland.Lorentz.Entrypoints (expectFailure)
test_duplicateEntrypoints :: TestTree
test_duplicateEntrypoints = testContractMatchesEntrypoints "Ill-typed contract fails the test"
illTypedContract mempty
& expectFailure "Duplicated entrypoint names: 'do1'"
where
n = unsafeMkAnnotation ""
do1 = unsafeMkAnnotation "do1"
illTypedContract =
Contract
{ contractParameter = ParameterType (
Ty (TOr do1 do1 (Ty TInt n)
(Ty (TPair n n n n (Ty TInt n) (Ty TInt n)) n)) n) n
, contractStorage = Ty TUnit n
, contractCode = []
, entriesOrder = PSC
, contractViews = []
}