Skip to content

Tests for default argument of nth #82

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

Merged
merged 2 commits into from
Mar 11, 2025
Merged

Conversation

phtrivier
Copy link
Contributor

@frenchy64 tests related to jank-lang/jank#294

± |nth-default-tests ✓| → clj --version
Clojure CLI version 1.11.3.1463

± |nth-default-tests ✓| → lein test clojure.core-test.nth
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.

lein test clojure.core-test.nth

Ran 1 tests containing 12 assertions.
0 failures, 0 errors.

Copy link
Contributor

@frenchy64 frenchy64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Feel free to put more tests for more boundary conditions.

;; `nth` accepts a default argument
(is (= :default (nth nil 0 :default)))
(is (= :default (nth [0] 1 :default)))
(is (= :default (nth [0 1] 2 :default)))))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also get a test for a negative number in here, please. Like we have on line 16, except it returns the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@phtrivier phtrivier requested a review from jeaye March 10, 2025 20:26
@jeaye jeaye merged commit 97c68ee into jank-lang:main Mar 11, 2025
2 checks passed
@jeaye
Copy link
Member

jeaye commented Mar 11, 2025

Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants