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

Assertion Failure Should List Name #39

Open
notnil opened this issue Jan 31, 2022 · 0 comments
Open

Assertion Failure Should List Name #39

notnil opened this issue Jan 31, 2022 · 0 comments

Comments

@notnil
Copy link

notnil commented Jan 31, 2022

Something like this:

g.AssertJson(t, "test_case_23.json", jsonData)

Will result in:

Result did not match the golden fixture. Diff is below:
        
        --- Expected
        +++ Actual
        @@ -1 +1,12 @@
        -[]
        +[
        +  {
        +    "Min": {
        +      "X": 7,
        +      "Y": 3
        +    },
        +    "Max": {
        +      "X": 28,
        +      "Y": 50
        +    }
        +  }
        +]

For table driven tests, you can't tell which one failed. I propose adding the name field to the assert failure logging.

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