-
Notifications
You must be signed in to change notification settings - Fork 26
Test persistent! #794
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
base: main
Are you sure you want to change the base?
Test persistent! #794
Conversation
E-A-Griffin
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.
Can you test that transient operations (e.g. conj!) throw an Exception after calling persistent!, since the docstring mentions this as behavior?
| @@ -1,5 +1,5 @@ | |||
| (ns clojure.core-test.assoc-bang | |||
| (:require [clojure.test :refer [deftest testing are]] | |||
| (:require [clojure.test :refer [are deftest testing is]] | |||
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.
These should be alphabetic in the template, I'll push up a fix for this
I added cases for this behavior in the tests of the transient operations. See in this PR EDIT - added case for |
76624de to
97f18a5
Compare
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.
Thank you!
| #{} (transient #{}) | ||
| #{nil} (transient #{nil}) | ||
| #{:a :b :c} (transient #{:a :b :c}))) | ||
|
|
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 think we'll want a test for calling persistent! multiple times on a transient, since that will throw. We don't need to do it for every possible shape, but we do want to capture that behavior, since it's documented.
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, added case for this behavior.
This closes jank-lang#394.
97f18a5 to
55aeefb
Compare
This closes #394.