Skip to content

Commit 0c02489

Browse files
authored
All names are printed with their unique values by default. (#5972)
* chore: explicit imports * Test demonstrates that without printed unique value a name won't roundtrip printing/parsing * Pretty-printing with indexes by default, simple representation by opt-in. * Updated golden files
1 parent 19f192d commit 0c02489

File tree

633 files changed

+25148
-35397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

633 files changed

+25148
-35397
lines changed

cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Cardano.Constitution.Validator.TestsCommon
99
import Helpers.TestBuilders
1010
import PlutusCore.Evaluation.Machine.ExBudget
1111
import PlutusCore.Evaluation.Machine.ExBudgetingDefaults
12-
import PlutusCore.Pretty (prettyPlcReadableDef)
12+
import PlutusCore.Pretty (prettyPlcReadable)
1313
import PlutusLedgerApi.V3 as V3
1414
import PlutusLedgerApi.V3.ArbitraryContexts as V3
1515
import PlutusTx.Code as Tx
@@ -56,13 +56,13 @@ test_budget_small = testGroup "BudgetSmall" $ M.elems $
5656
test_readable_pir = testGroup "ReadablePir" $ M.elems $
5757
(\vName (_, vCode) ->
5858
goldenVsString vName (mkPath vName ["pir"]) $
59-
pure $ fromString $ show $ prettyPlcReadableDef $ fromJust $ getPirNoAnn vCode
59+
pure $ fromString $ show $ prettyPlcReadable $ fromJust $ getPirNoAnn vCode
6060
)`M.mapWithKey` defaultValidatorsWithCodes
6161

6262
test_readable_uplc = testGroup "ReadableUplc" $ M.elems $
6363
(\vName (_, vCode) ->
6464
goldenVsString vName (mkPath vName ["uplc"]) $
65-
pure $ fromString $ show $ prettyPlcReadableDef $ getPlcNoAnn vCode
65+
pure $ fromString $ show $ prettyPlcReadable $ getPlcNoAnn vCode
6666
)`M.mapWithKey` defaultValidatorsWithCodes
6767

6868
tests :: TestTreeWithTestState

cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.pir.golden

Lines changed: 5668 additions & 5243 deletions
Large diffs are not rendered by default.

cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.uplc.golden

Lines changed: 1077 additions & 1076 deletions
Large diffs are not rendered by default.

cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.pir.golden

Lines changed: 5618 additions & 5170 deletions
Large diffs are not rendered by default.

cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.uplc.golden

Lines changed: 1375 additions & 1396 deletions
Large diffs are not rendered by default.

plutus-benchmark/cek-calibration/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ writePlc p =
8282
traverseOf UPLC.progTerm UPLC.unDeBruijnTerm p
8383
of
8484
Left e -> throw e
85-
Right p' -> Haskell.print . PP.prettyPlcClassicDebug $ p'
85+
Right p' -> Haskell.print . PP.prettyPlcClassicSimple $ p'
8686

8787

8888
main1 :: Haskell.IO ()

plutus-benchmark/nofib/exe/Main.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import PlutusCore.Default (DefaultFun, DefaultUni)
3535
import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (..))
3636
import PlutusCore.Evaluation.Machine.ExBudgetingDefaults qualified as PLC
3737
import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (..), ExMemory (..))
38-
import PlutusCore.Pretty (prettyPlcClassicDebug)
38+
import PlutusCore.Pretty (prettyPlcClassicSimple)
3939
import PlutusTx (getPlcNoAnn)
4040
import PlutusTx.Code (CompiledCode, sizePlc)
4141
import PlutusTx.Prelude hiding (fmap, mappend, traverse_, (<$), (<$>), (<*>), (<>))
@@ -311,7 +311,7 @@ main :: IO ()
311311
main = do
312312
execParser (info (helper <*> options) (fullDesc <> progDesc description <> footerDoc (Just footerInfo))) >>= \case
313313
RunPLC pa ->
314-
print . prettyPlcClassicDebug . evaluateWithCek . getTerm $ pa
314+
print . prettyPlcClassicSimple . evaluateWithCek . getTerm $ pa
315315
RunHaskell pa ->
316316
case pa of
317317
Clausify formula -> print $ Clausify.runClausify formula
@@ -322,7 +322,7 @@ main = do
322322
Primetest n -> if n<0 then Hs.error "Positive number expected"
323323
else print $ Prime.runPrimalityTest n
324324
DumpPLC pa ->
325-
traverse_ putStrLn $ unindent . prettyPlcClassicDebug . UPLC.Program () PLC.latestVersion . getTerm $ pa
325+
traverse_ putStrLn $ unindent . prettyPlcClassicSimple . UPLC.Program () PLC.latestVersion . getTerm $ pa
326326
where unindent d = map (dropWhile isSpace) $ (Hs.lines . Hs.show $ d)
327327
DumpFlatNamed pa ->
328328
writeFlatNamed . UPLC.Program () PLC.latestVersion . getTerm $ pa

plutus-benchmark/nofib/test/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ runTestGhc = runTestNested ["nofib", "test"] . pure . testNestedGhc
3232
-- Unit tests comparing PLC and Haskell computations on given inputs
3333

3434
runAndCheck :: Tx.Lift DefaultUni a => Term -> a -> IO ()
35-
runAndCheck term value = cekResultMatchesHaskellValue term (@?=) value
35+
runAndCheck term = cekResultMatchesHaskellValue term (@?=)
3636

3737
---------------- Clausify ----------------
3838

plutus-benchmark/script-contexts/test/Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ assertSucceeded t =
2525
case runTermCek t of
2626
(Right _, _) -> pure ()
2727
(Left err, logs) -> assertFailure . Text.unpack . Text.intercalate "\n" $
28-
[ render (prettyPlcClassicDebug err)
28+
[ render (prettyPlcClassicSimple err)
2929
, "Cek logs:"
3030
] ++ logs
3131

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Changed
2+
3+
- All names are printed with their unique suffixes by default.

0 commit comments

Comments
 (0)