-
Notifications
You must be signed in to change notification settings - Fork 27
Add tests for <=
#838
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
Open
dgr
wants to merge
1
commit into
jank-lang:main
Choose a base branch
from
dgr:dgr-lt-eq
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add tests for <=
#838
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E-A-Griffin
reviewed
Dec 6, 2025
| (is (thrown? Exception (<= 1 nil))) | ||
| (is (thrown? Exception (<= nil 1 2))) | ||
| (is (thrown? Exception (<= 1 2 nil))) | ||
| (is (= true (<= "1" "2"))) |
Collaborator
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.
This is a surprise
Collaborator
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.
@dmiller this behavior is surprising given it's both different from C# and Clojure
E-A-Griffin
approved these changes
Dec 6, 2025
Contributor
|
Assuming you are referring to the final test, on strings.
That is the same cause as came up recently on another numeric test:
IConvertible on strings.
Will only work for strings that convert to numbers. It won't work on
arbitrary strings.
…On Fri, Dec 5, 2025 at 11:04 PM Emma Griffin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/clojure/core_test/lt_eq.cljc
<#838 (comment)>
:
> + ;; JavaScript under the hood) where comparisons are just a bit
+ ;; of a mess.
+ #?@(:cljs
+ [(is (= true (<= nil 1)))
+ (is (= false (<= 1 nil)))
+ (is (= true (<= nil 1 2)))
+ (is (= false (<= 1 2 nil)))
+ (is (= true (<= "1" "2")))
+ (is (= false (<= "foo" "bar")))
+ (is (= false (<= :foo :bar)))]
+ :cljr
+ [(is (thrown? Exception (<= nil 1)))
+ (is (thrown? Exception (<= 1 nil)))
+ (is (thrown? Exception (<= nil 1 2)))
+ (is (thrown? Exception (<= 1 2 nil)))
+ (is (= true (<= "1" "2")))
@dmiller <https://github.com/dmiller> this behavior is surprising given
it's both different from C# and Clojure
—
Reply to this email directly, view it on GitHub
<#838 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAUVZLQWYXLB3ZLZAJJ4ML4AJIVLAVCNFSM6AAAAACOGTWDHGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKNBXGEYTEMZUGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Contributor
|
Sounds good to me.
…On Sat, Dec 6, 2025 at 11:34 AM Dave Roberts ***@***.***> wrote:
*dgr* left a comment (jank-lang/clojure-test-suite#838)
<#838 (comment)>
I could add tests to validate that it won't compare arbitrary strings
(e.g., (<= "bar" "foo") throws).
—
Reply to this email directly, view it on GitHub
<#838 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAUVZKVBKTBPA6NFV76X7D4AMAQBAVCNFSM6AAAAACOGTWDHGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRQGY3DIOJXHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #120