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

Should context strings apply to multiple forms if there are no line breaks? #8

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

Comments

@matthewdowney
Copy link
Owner

^:rct/test
(comment
  ;; Literal assertions with =>
  (range 3) ;=> (0 1 2)
  (+ 5 5) ;; => 10

  ;; Pattern matching assertions with =>>
  (range 3) ;=>> '(0 1 ...)
  (+ 5 5) ;=>> int?

For example, it seems like "Literal assertions with =>" should apply to the first two forms. Maybe this is "too smart" though.

@matthewdowney
Copy link
Owner Author

Example of the semantics I landed on here:

(deftest context-strings-test
(m/assert
'{(* 0 0) ""
(+ 1 1) ";; Test for\n;; addition"
(+ 2 2) ";; Test for\n;; addition"
(* 1 1) ""
(* 2 3) ""
(* 2 2) ";; Squares\n;; and such"
(* 3 3) ";; Squares\n;; and such\n; 3 squared"}
(ctx-strings
"(* 0 0) ;=> 0
;; Test for
;; addition
(+ 1 1) ;=> 2
(+ 2 2) ;=> 4
(* 1 1) ;=> 1
(* 2 3) ;=> 6
;; Squares
;; and such
(* 2 2) ;=> 4
; 3 squared
(* 3 3) ;=> 9")))

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