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

Elipses in test expectation string like ;=> {:foo :bar ...} #1

Closed
matthewdowney opened this issue Dec 9, 2022 · 1 comment
Closed

Comments

@matthewdowney
Copy link
Owner

When I'm writing rich comments in general, not necessarily for test generation purposes, I often use elipses to truncate the output I show, like:

(comment
  (range 10)
  ;=> (0 1 2 ...)

  (let [chars (take 26 (iterate #(char (inc (int %))) \a))]
    (zipmap (range) chars))
  ;=> {0 \a
  ;    1 \b
  ;    ...}
  )

It'd be cool to support something like that, so that the tests aren't all or nothing.

@matthewdowney
Copy link
Owner Author

For the record, this works with matcho assertions (#2) in comments which begin =>> instead of =>, so:

; You can write this
(let [chars (take 26 (iterate #(char (inc (int %))) \a))]
  (zipmap (range) chars))
;=>> {0 \a, 1 \b, ...}

; But not this
*1 ;=> {0 \a ...} ; <- this will throw an exception

=> remains strictly and simply a literal assertion of equality.

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

No branches or pull requests

1 participant