diff --git a/examples/sample-bad-bundle/badmod.janet b/examples/sample-bad-bundle/badmod.janet new file mode 100644 index 00000000..bae8931b --- /dev/null +++ b/examples/sample-bad-bundle/badmod.janet @@ -0,0 +1 @@ +(def abc 123) diff --git a/examples/sample-bad-bundle/bundle.janet b/examples/sample-bad-bundle/bundle.janet new file mode 100644 index 00000000..a27c6984 --- /dev/null +++ b/examples/sample-bad-bundle/bundle.janet @@ -0,0 +1,7 @@ +(defn install + [manifest &] + (bundle/add-file manifest "badmod.janet")) + +(defn check + [&] + (error "Check failed!")) diff --git a/test/suite-bundle.janet b/test/suite-bundle.janet index a0f4c031..f860c1fd 100644 --- a/test/suite-bundle.janet +++ b/test/suite-bundle.janet @@ -117,6 +117,11 @@ (assert (= 0 (length (bundle/list))) "bundles are listed correctly 7") (assert (= 0 (length (bundle/topolist))) "bundles are listed correctly 8") +# Try installing a bundle that fails check +(assert-error "bad test" (bundle/install "./examples/sample-bad-bundle" :check true)) +(assert (= 0 (length (bundle/list))) "check failure 0") +(assert (= 0 (length (bundle/topolist))) "check failure 1") + (rmrf syspath) (end-suite)