diff --git a/pact-tests/Pact/Core/Test/DocsTests.hs b/pact-tests/Pact/Core/Test/DocsTests.hs index cac884062..3f7ab3b15 100644 --- a/pact-tests/Pact/Core/Test/DocsTests.hs +++ b/pact-tests/Pact/Core/Test/DocsTests.hs @@ -5,7 +5,7 @@ import qualified Data.Set as S import Data.Text (Text) import qualified Data.Text as T import Pact.Core.Builtin -import Paths_pact_tng +import Pact.Core.Repl.BuiltinDocs.Internal import System.Directory import System.FilePath import Test.Tasty @@ -24,7 +24,7 @@ tests = do docsExistsTest :: [Text] -> TestTree docsExistsTest b = testCase "Builtins should have docs" $ do - let normBuiltins = normalizeBuiltinName <$> replCoreBuiltinNames + let normBuiltins = builtinToNormalizedName <$> replCoreBuiltinNames let diff = (S.fromList normBuiltins `S.difference` excluded) `S.difference` S.fromList b assertEqual "Missing builtins should be empty" S.empty diff where @@ -34,31 +34,3 @@ docsExistsTest b = testCase "Builtins should have docs" $ do ,"env-set-milligas", "env-stackframe", "env-verifiers", "negate" ,"pact-state", "print", "reset-pact-state", "rollback-tx", "show" ,"sig-keyset", "test-capability"] - -normalizeBuiltinName :: Text -> Text -normalizeBuiltinName = \case - "!=" -> "neq" - "&" -> "and" - "*" -> "mult" - "+" -> "add" - "-" -> "sub" - "/" -> "div" - "<" -> "lt" - "<=" -> "leq" - "=" -> "eq" - ">" -> "gt" - ">=" -> "geq" - "^" -> "pow" - "and?" -> "and-q" - "not?" -> "not-q" - "or?" -> "or-q" - "|" -> "bitwise-or" - "~" -> "bitwise-reverse" - "begin-named-tx" -> "begin-tx" - "continue-pact-rollback-yield" -> "continue-pact" - "continue-pact-rollback-yield-object" -> "continue-pact" - "continue-pact-with-rollback" -> "continue-pact" - "enforce-pact-version-range" -> "enforce-pact-version" - "env-set-gas" -> "env-gas" - "expect-failure-match" -> "expect-failure" - other -> other diff --git a/pact/Pact/Core/Repl/BuiltinDocs/Internal.hs b/pact/Pact/Core/Repl/BuiltinDocs/Internal.hs index 2df6ef516..ab44ffbe0 100644 --- a/pact/Pact/Core/Repl/BuiltinDocs/Internal.hs +++ b/pact/Pact/Core/Repl/BuiltinDocs/Internal.hs @@ -49,7 +49,7 @@ mkBuiltinDocs = embedIO action builtinToNormalizedName :: T.Text -> T.Text builtinToNormalizedName = \case "!=" -> "neq" - "&" -> "and" + "&" -> "bitwise-and" "*" -> "mult" "+" -> "add" "-" -> "sub" @@ -77,7 +77,7 @@ builtinToNormalizedName = \case normalizedNameToBuiltin :: T.Text -> T.Text normalizedNameToBuiltin = \case "neq" -> "!=" - "and" -> "&" + "bitwise-and" -> "&" "mult" -> "*" "add" -> "+" "sub" -> "-"