Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ build:
test:
eask compile
eask emacs --batch -L . -L test -l test/all-tests.el -f ert-run-tests-batch-and-exit

test-one TEST_NAME:
eask compile
eask emacs --batch -L . -L test -l test/all-tests.el -eval '(ert-run-tests-batch-and-exit "{{TEST_NAME}}")'
19 changes: 19 additions & 0 deletions test/rustic-babel-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,23 @@
(rustic-test-babel-execute-block buf)
(should (string-equal (rustic-test-babel-check-results buf) "[[\"A\", \"B\"], [\"C\", \"D\"]]\n")))))

(ert-deftest rustic-test-babel-block-with-paths ()
(let* ((current-test-dir (or (and load-file-name (file-name-directory load-file-name))
(and buffer-file-name (file-name-directory buffer-file-name))
default-directory)) ; Fallback to `default-directory`
(string "use foo;
use bar;
fn main() {
foo::foo();
bar::bar();
}")
(params (format ":paths '((foo . \"%s/test-project/crates/foo\") (bar . \"%s/test-project/crates/bar\")) :crates '((foo . 0.0.1) (bar . 0.0.1))"
(expand-file-name "test" current-test-dir)
(expand-file-name "test" current-test-dir)))
(buf (rustic-test-get-babel-block string params)))
(with-current-buffer buf
(rustic-test-babel-execute-block buf)
(should (eq (rustic-test-babel-check-results buf) nil)))))


(provide 'rustic-babel-test)
10 changes: 9 additions & 1 deletion test/test-project/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/test-project/crates/bar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[package]
name = "bar"
version = "0.0.1"
3 changes: 3 additions & 0 deletions test/test-project/crates/bar/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn bar() {
()
}
3 changes: 3 additions & 0 deletions test/test-project/crates/foo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[package]
name = "foo"
version = "0.0.1"
3 changes: 3 additions & 0 deletions test/test-project/crates/foo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn foo() {
()
}
Loading