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

uassert/urequire: Messages from PanicsWithMessage method are inverted #2503

Closed
ajnavarro opened this issue Jul 4, 2024 · 2 comments
Closed
Assignees
Labels
🐞 bug Something isn't working 🧾 package/realm Tag used for new Realms or Packages.

Comments

@ajnavarro
Copy link
Contributor

uassert/urequire: Messages from PanicsWithMessage method are inverted

Description

When a panic with a specific message is expected but the output is not the same, the test error message is wrong.

Steps to reproduce

Use the PanicsWithMessage method from uassert/urequire.

Expected behavior

Executing:

urequire.PanicsWithMessage(t, "ppp", func() {
		ExecuteProposal(pid)
	})

Output should be:

=== RUN   TestPackage
func should panic with message: ppp
        Panic value:   OTHER PANIC VALUE

Actual behavior

Executing:

urequire.PanicsWithMessage(t, "ppp", func() {
		ExecuteProposal(pid)
	})

Output is:

=== RUN   TestPackage
func should panic with message: OTHER PANIC VALUE
        Panic value:   ppp
@ajnavarro ajnavarro added 🐞 bug Something isn't working 🧾 package/realm Tag used for new Realms or Packages. labels Jul 4, 2024
@linhpn99
Copy link
Contributor

linhpn99 commented Jul 4, 2024

Here is the hotfix PR #2506

zivkovicmilos pushed a commit that referenced this issue Jul 5, 2024
Related to #2503

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
@zivkovicmilos
Copy link
Member

Closed by #2506

Thank you @linhpn99 for the fix 🙏

gfanton pushed a commit to gfanton/gno that referenced this issue Jul 23, 2024
Related to gnolang#2503

<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🧾 package/realm Tag used for new Realms or Packages.
Projects
Development

No branches or pull requests

3 participants