Skip to content

Commit

Permalink
Test bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpakin committed Oct 5, 2024
1 parent 99f0af9 commit 3d93028
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/sample-bad-bundle/badmod.janet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(def abc 123)
7 changes: 7 additions & 0 deletions examples/sample-bad-bundle/bundle.janet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(defn install
[manifest &]
(bundle/add-file manifest "badmod.janet"))

(defn check
[&]
(error "Check failed!"))
5 changes: 5 additions & 0 deletions test/suite-bundle.janet
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3d93028

Please sign in to comment.