-
Notifications
You must be signed in to change notification settings - Fork 26
Test vec #792
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 vec #792
Conversation
This closes jank-lang#563.
| (aset arr 0 -1) | ||
| (is (= [-1 2 3] v))))) |
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.
Small nitpick, even though it's not required, it might be clearer that this mutation and the assertion are related if they were in a do block or logically grouped in some other way like doto). Not a big thing just weird to see mutating code in Clojure without a ! suffix, but I won't block on this
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.
I agree this mutable code is surprising but I don't see how to test this case differently. I wonder why aset is aset and not aset! 😅
clj-kondo warns of "redundant do" when adding a do under let.
I don't see how to apply doto here 🤔
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.
Oh yeah since you're testing v rather than arr in the assertion that wouldn't work, I'll drop the comment, thanks for checking
| [\a \b \c] "abc")) | ||
|
|
||
| #?(:cljr "cljr does not alias array" | ||
| :default (testing "array aliasing" |
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.
Very neat test case.
jeaye
left a comment
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.
Nice work!
This closes #563.