History

differentiate between args error and arity error; assert must use print not princ

Sigrid Solveig Haflínudóttir committed 1 year ago

Commit 10691411 parent c0140954 files · +22 −13Browse files

Showing the changes to test (1 of 4 files). Show all

Unified · Split

test/unittest.sl+6−6
@@ -839,9 +839,9 @@ · 838 unmodified lines
839 839
840(assert (eq? (sym 'blah) 'blah))840(assert (eq? (sym 'blah) 'blah))
841(assert (eq? (sym "hi" "there" 'symbol 123) 'hitheresymbol123))841(assert (eq? (sym "hi" "there" 'symbol 123) 'hitheresymbol123))
842(assert-fail (sym) arg-error)842(assert-fail (sym) arity-error)
843 843
844(assert-fail (exit "error" 2) arg-error)844(assert-fail (exit "error" 2) arity-error)
845 845
846(assert (not (int-valued? T)))846(assert (not (int-valued? T)))
847(assert (not (int-valued? NIL)))847(assert (not (int-valued? NIL)))
@@ -991,7 +991,7 @@ · 143 unmodified lines
991; path-cwd991; path-cwd
992(assert (str? (path-cwd)))992(assert (str? (path-cwd)))
993(assert (path-cwd "."))993(assert (path-cwd "."))
994(assert-fail (path-cwd "." ".") arg-error)994(assert-fail (path-cwd "." ".") arity-error)
995(assert-fail (path-cwd "does/not/exist") io-error)995(assert-fail (path-cwd "does/not/exist") io-error)
996 996
997; path-exists? + delete-file997; path-exists? + delete-file
@@ -1014,9 +1014,9 @@ · 16 unmodified lines
1014(assert (os-setenv "thisvarisdefined" NIL))1014(assert (os-setenv "thisvarisdefined" NIL))
1015(assert (not (os-getenv "thisvarisdefined")))1015(assert (not (os-getenv "thisvarisdefined")))
1016(assert-fail (os-getenv))1016(assert-fail (os-getenv))
1017(assert-fail (os-getenv "abc" "def"))1017(assert-fail (os-getenv "abc" "def") arity-error)
1018(assert-fail (os-setenv))1018(assert-fail (os-setenv) arity-error)
1019(assert-fail (os-setenv "" "def"))1019(assert-fail (os-setenv "" "def") arg-error)
1020(if (equal? *os-name* "plan9")1020(if (equal? *os-name* "plan9")
1021 (begin (assert-fail (os-setenv ".." "def"))1021 (begin (assert-fail (os-setenv ".." "def"))
1022 (assert (not (os-getenv ".."))))1022 (assert (not (os-getenv ".."))))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t