To run the tests using Nix:
$ cd $projectroot/plutarch-test
# Runs tests
$ nix run .#test-ghc9
# To run the above in GHC 8.10 instead:
$ nix run .#test-ghc810
To run the tests using ghcid (fit for writing tests):
bin/ghcid test
To run ghcid with development flag set:
bin/ghcid test:dev
Note: cabal run
should be run inside ./plutarch-test
directory.
To quickly navigate and preview the golden files in the terminal, run:
nix run nixpkgs#ranger -- ./plutarch-test/goldens/
Then hit zv
to toggle on preview. Use hjkl
to naviate.
When writing tests you may want to clean up working copy goldens, and start from base. To do this, run:
rm plutarch-test/goldens/*.golden; git restore --source=HEAD --staged --worktree -- plutarch-test/goldens/