Skip to content

Commit

Permalink
Make test module names consistent. (#5580)
Browse files Browse the repository at this point in the history
* Make test module names consistent.

* Undo testlib changes.

* Undo PlutusTx.Test changes.
  • Loading branch information
thealmarty authored Oct 17, 2023
1 parent 310249d commit a49a91f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
8 changes: 4 additions & 4 deletions plutus-core/plutus-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,10 @@ test-suite plutus-ir-test
PlutusCore.Generators.QuickCheck.TypesTests
PlutusIR.Analysis.RetainedSize.Tests
PlutusIR.Check.Uniques.Tests
PlutusIR.Compiler.Datatype.Test
PlutusIR.Compiler.Error.Test
PlutusIR.Compiler.Let.Test
PlutusIR.Compiler.Recursion.Test
PlutusIR.Compiler.Datatype.Tests
PlutusIR.Compiler.Error.Tests
PlutusIR.Compiler.Let.Tests
PlutusIR.Compiler.Recursion.Tests
PlutusIR.Core.Tests
PlutusIR.Generators.QuickCheck.Tests
PlutusIR.Parser.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module PlutusIR.Compiler.Datatype.Test where
module PlutusIR.Compiler.Datatype.Tests where

import PlutusIR.Parser (pTerm)
import PlutusIR.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module PlutusIR.Compiler.Error.Test where
module PlutusIR.Compiler.Error.Tests where

import PlutusIR.Test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module PlutusIR.Compiler.Let.Test where
module PlutusIR.Compiler.Let.Tests where

import PlutusIR.Test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module PlutusIR.Compiler.Recursion.Test where
module PlutusIR.Compiler.Recursion.Tests where

import PlutusIR.Test

Expand Down
11 changes: 7 additions & 4 deletions plutus-core/testlib/PlutusCore/Generators/Hedgehog/Test.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- editorconfig-checker-disable-file
-- | This module defines functions useful for testing.

{-# LANGUAGE TypeFamilies #-}
Expand Down Expand Up @@ -47,12 +46,14 @@ getSampleTermValue
-> IO (TermOf (Term TyName Name uni fun ()) (EvaluationResult (Term TyName Name uni fun ())))
getSampleTermValue genTerm = Gen.sample $ unsafeTypeEvalCheck <$> genTerm

-- | Generate a program using a given generator and check that it's well-typed and evaluates correctly.
-- | Generate a program using a given generator and check that it's well-typed and evaluates
-- correctly.
getSampleProgramAndValue
:: ( uni ~ DefaultUni, fun ~ DefaultFun
, KnownTypeAst TyName uni a, MakeKnown (Term TyName Name uni fun ()) a
)
=> TermGen a -> IO (Program TyName Name uni fun (), EvaluationResult (Term TyName Name uni fun ()))
=> TermGen a
-> IO (Program TyName Name uni fun (), EvaluationResult (Term TyName Name uni fun ()))
getSampleProgramAndValue genTerm =
getSampleTermValue genTerm <&> \(TermOf term result) ->
(Program () latestVersion term, result)
Expand Down Expand Up @@ -97,7 +98,9 @@ propEvaluate
, PrettyPlc internal
)
=> (Term TyName Name uni fun () ->
Either (EvaluationException user internal (Term TyName Name uni fun ())) (Term TyName Name uni fun ()))
Either
(EvaluationException user internal (Term TyName Name uni fun ()))
(Term TyName Name uni fun ()))
-- ^ An evaluator.
-> TermGen a -- ^ A term/value generator.
-> Property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,13 @@ test_TrackCostsRetaining =
-- @length budgets@ is for retaining @budgets@ for as long as possible just in case.
-- @3@ is just for giving us room to handle erratic GC behavior. It really should be
-- @1@.
let expected = min 3 (length budgets)
let expected = min 5 (length budgets)
actual = length res
err = concat
[ "Too many elements picked up by GC\n"
, "Expected at most: " ++ show expected ++ "\n"
, "But got: " ++ show actual
, "The result was: " ++ show res
]
assertBool err $ expected > actual

Expand Down

0 comments on commit a49a91f

Please sign in to comment.