Merged
Conversation
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.
@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:
***@***.***>
|
Member
|
Thanks, Dave! |
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
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