https://git.jolheiser.com/scripts.git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
use std assert use ,.nu alias comma = , use gomodsri.nu #[test] def test_comma [] { let hello = (comma hello) assert equal $hello "Hello, world!" } #[test] def test_gomodsri [] { let tmp = (mktemp -d) mut pass = true try { cd $tmp go mod init example.com/gomodsri go get github.com/catppuccin/go@93b825698724c5681dcd78b0c37932f6c72eeda0 gomodsri assert equal (open --raw go.mod.sri) "sha256-htxaRv2gLGyCVTUikrEs7av6lWrxdoU6kzEBgV8WaqE=" } catch { pass = false } cd .. rm -r $tmp assert $pass }