-
Notifications
You must be signed in to change notification settings - Fork 22
test juxt
#756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
test juxt
#756
Conversation
d126c9c
to
2f8b271
Compare
(is (= ["12345678910" 1 10] | ||
((juxt str min max) 1 2 3 4 5 6 7 8 9 10)))) | ||
|
||
(testing "'returns a fn that is the juxtaposition of those fns'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Dave. The tests look good. One oddity stands out, though.
These four testing
forms have double insulation of quoting. Was that intentional? I don't think we're using that anywhere else.
(testing "wrong-shape input is mostly accepted (and throws when invoked)" | ||
(is (thrown? #?(:cljs :default, :clj java.lang.NullPointerException) | ||
((juxt nil)))) | ||
(is (thrown? #?(:cljs :default, :clj Exception) | ||
((juxt (range))))) | ||
(is (thrown? #?(:cljs :default, :clj Exception) | ||
((juxt 1))))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(testing "wrong-shape input is mostly accepted (and throws when invoked)" | |
(is (thrown? #?(:cljs :default, :clj java.lang.NullPointerException) | |
((juxt nil)))) | |
(is (thrown? #?(:cljs :default, :clj Exception) | |
((juxt (range))))) | |
(is (thrown? #?(:cljs :default, :clj Exception) | |
((juxt 1))))))) | |
(testing "wrong-shape input is mostly accepted (and throws when invoked)" | |
#?(:cljs (is (thrown? :default ((juxt nil)))) | |
:clj (is (thrown? java.lang.NullPointerException ((juxt nil)))) | |
:clr (is (thrown? System.NullReferenceException ((juxt nil))) | |
#?@(:cljs [(is (thrown? :default ((juxt (range)))) | |
(is (thrown? :default ((juxt 1))))] | |
:default [(is (thrown? Exception ((juxt (range)))) | |
(is (thrown? Exception ((juxt 1))))]) |
closes #327