Skip to content
Snippets Groups Projects
Commit 9e8a7ae9 authored by Elliott Shugerman's avatar Elliott Shugerman
Browse files

basic test setup with janet

parent 4899f4e8
No related branches found
No related tags found
No related merge requests found
;;; Directory Local Variables
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")
((sh-mode . ((sh-basic-offset . 2))))
((nil . ((eval . (progn
(setq janet-interpreter-command "jpm")
(setq janet-interpreter-arguments '("-l" "janet" "-s"))))))
(sh-mode . ((sh-basic-offset . 2))))
......@@ -2,3 +2,4 @@
.env
test/.env
/test/.direnv/
/test/jpm_tree/
......@@ -9,6 +9,8 @@
buildInputs = with pkgs; [
nushell
docker
janet
jpm
];
};
});
......
(declare-project
:dependencies ["https://github.com/pyrmont/testament"
"https://github.com/andrewchambers/janet-sh"])
(import testament :prefix "" :exit true)
(import sh)
(deftest two-plus-two
(is (= 5 (+ 2 2)) "2 + 2 = 5"))
(deftest one-plus-one
(is (= 2 (+ 1 1)) "1 + 1 = 2"))
(deftest echo-hi-pass
(assert-equal (string/trim (sh/$< echo "hi")) "hi"))
(deftest echo-hi-fail
(assert-equal (string/trim (sh/$< echo "hi")) "bye"))
(run-tests!)
# TODO: port to janet?
# $nu
# $$ use std testing run tests
# $$ use std testing run-tests
# $$ run-tests --threads=0
use std log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment