diff options
| author | 2024-10-05 12:37:23 -0500 | |
|---|---|---|
| committer | 2024-10-05 12:37:23 -0500 | |
| commit | 3d9302808812ebd7a736f6ae892cab27d724fa79 (patch) | |
| tree | 19ed77f75aa02011229ad113b62fc8007160c4e9 | |
| parent | Fix bundle/install with :check true installation failure. (diff) | |
Test bundle
| -rw-r--r-- | examples/sample-bad-bundle/badmod.janet | 1 | ||||
| -rw-r--r-- | examples/sample-bad-bundle/bundle.janet | 7 | ||||
| -rw-r--r-- | test/suite-bundle.janet | 5 |
3 files changed, 13 insertions, 0 deletions
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) |
