Login
7 branches 0 tags
Ben (Win10) Removed the C based printer and the [cat] NFunc b25df4d 3 years ago 836 Commits
nujel / tests / testsuite / casting.nuj
[test/add 1 [read/int "1"]]
[test/add 1 [read/int "1.0"]]
[test/add 1 [read/int "1.2"]]
[test/add 1 [read/int "      \n\t1"]]
[test/add -1 [read/int "-1"]]
[test/add -1 [read/int " -1"]]
[test/add :type-error [try car [let [[a 10]] [when [when #t [set! a [+ 2 "2"]] #f] [set! a -1]] a]]]
;[test/add :type-error [try car [apply [fn [α] [+ 1 α]]]]]
;[test/add :type-error [try car [def cb [fn [α] [+ 1 α]]] [apply cb]]]
;[test/add :type-error [try car [let [[cb [fn [α] [+ 1 α]]]] [apply cb]]]]
;[test/add :type-error [try car [let* [def cb [fn [α] [+ 1 α]]] [apply cb]]]]
[test/add :type-error [try car [+ '1 '[2]]]]
[test/add :type-error [try car [- '1 '[2]]]]
[test/add :type-error [try car [- '1 '[2 3]]]]
[test/add :type-error [try [fn [e] [car e]] [+ "1" "2"]]]
[test/add :type-error [try [fn [e] [car e]] [sin 1]]]
[test/add :type-error [try [fn [e] [car e]] [ceil 1]]]
[test/add :type-error [try [fn [e] [car e]] [floor 1]]]
[test/add :type-error [try [fn [e] [car e]] [round 1]]]
[test/add :type-error [try car [bytecompile '[def #nil #nil]]]]
[test/add :type-error [try car [bytecompile '[set! #nil #nil]]]]
[test/add :type-error [try car [bytecompile '[def]]]]
[test/add :type-error [try car [bytecompile '[set!]]]]
[test/add :type-error [try car [+ #x10#f]]]
[test/add :type-error [try car [+ #x10"16"]]]
[test/add :type-error [try car [int "8"]]]
;[test/add :type-error [try car [+ [cadr '[1 2]] [cadr #nil] [cadr '[1]]]]]
[test/add :type-error [try car [int "a1"]]]
[test/add :type-error [try car [int "1a"]]]
[test/add :type-error [try car [int "1 a"]]]
[test/add :type-error [try car [def cb '+] [apply cb]]]