Skip to content
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

Move =? cond to function to reduce generated code #40

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

NoahTheDuke
Copy link
Contributor

Related to NoahTheDuke/lazytest#13, this moves the big cond block from =? to a separate function, which reduces generated code size. I also changed the msg generation to be eager so (pr-str e') and (pr-str (list 'expect e' a)) don't bloat the generated code either.

@@ -218,7 +222,7 @@
a#)})
(t/do-report
{:type :fail,
:message (if m# (if ~msg (str ~msg "\n" m#) m#) ~msg)
:message (if m# (if-let [msg# ~msg] (str msg# "\n" m#) m#) ~msg)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also evals msg once so it doesn't put a potentially big msg in multiple times (in addition to wasting effort executing it multiple times).

@seancorfield seancorfield merged commit d7763b9 into clojure-expectations:develop Nov 22, 2024
3 checks passed
@seancorfield
Copy link
Contributor

Have you made this change to LazyTest too, since you copied over a bunch of Expectations stuff?

seancorfield added a commit that referenced this pull request Nov 22, 2024
Signed-off-by: Sean Corfield <[email protected]>
@NoahTheDuke NoahTheDuke deleted the nb/=-impl branch November 22, 2024 22:31
@NoahTheDuke
Copy link
Contributor Author

Yeah I'm gonna move this over when I get a minute.

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.

2 participants