-
Notifications
You must be signed in to change notification settings - Fork 25
Test cycle #773
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
Test cycle #773
Conversation
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 for the PR!
test/clojure/core_test/cycle.cljc
Outdated
| (are [expr] (thrown? #?(:cljs js/Error :default Exception) (expr)) | ||
| (#'cycle) | ||
| (#'cycle [] []))))) |
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.
Arity checking is not handled by the function definition. It's handled by the runtime. We don't want to include calls to unsupported arities in our unit tests here, since it's not actually testing the function.
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.
Removed tests on bad arities.
test/clojure/core_test/cycle.cljc
Outdated
| 1 '() [] | ||
| 1 '(1 2 3) [1] | ||
| 3 '(1 2 3) [1 2 3] | ||
| 7 '(1 2 3) [1 2 3 1 2 3 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.
We can test infinite seqs here, too, since cycle needs to work with them. For example, (take 3 (cycle (range))).
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.
Added a test on infinite seq.
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.
Could we add some tests for other data structures since the docs for this specifically only require a collection (e.g. range, set, map, at least one associative collection besides vector, doesn't need to be all of them)
This closes jank-lang#207.
Added cases for set and map. |
|
Well done! |
This closes #207.