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

Add the option to display a diff when comparing strings #630

Open
SuperFola opened this issue Jun 2, 2024 · 0 comments
Open

Add the option to display a diff when comparing strings #630

SuperFola opened this issue Jun 2, 2024 · 0 comments

Comments

@SuperFola
Copy link

Expected Behavior

ut::diff_onerror(that % mystring == otherstring) could display a diff of mystring vs otherstring

Actual Behavior

that % mystring == otherstring will print some hard to read text when dealing with multiline strings:

Running test "output a correctly formatted code for calls"... FAILED
in: /Users/fola/Documents/ArkScript/Ark/lib/ut/include/boost/ut.hpp:2961 - test condition:  [(let newlist (list:filter _listeners (fun (element) (!= typ (@ element 0)))))

# a badly aligned method below
# this comment bloc is also a test
(list:forEach
  _listeners
  (fun (element)
    (if (= typ (@ element 0)) {
      ((@ element 1) val)
      (set found true) })))
 == (let newlist (list:filter _listeners (fun (element) (!= typ (@ element 0)))))


# a badly aligned method below
# this comment bloc is also a test
(list:forEach
  _listeners
  (fun (element)
    (if (= typ (@ element 0)) {
      ((@ element 1) val)
      (set found true) })))
]

Here there is a new line that shouldn't be there in the second sample, which is quite hard to spot

Steps to Reproduce the Problem

  1. create a test with boost::ut
  2. compare two (different) strings

Specifications

  • Version: 2.0.1
  • Platform: macos
  • Subsystem:
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