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

Improve p/uassert and p/urequire #2481

Open
moul opened this issue Jul 2, 2024 · 3 comments
Open

Improve p/uassert and p/urequire #2481

moul opened this issue Jul 2, 2024 · 3 comments
Labels
🗺️good first issue🗺️ Ideal for newcomer contributors hacktoberfest This might be a good issue for a hacktoberfest participant to handle. help wanted Want to contribute? We recommend these issues.

Comments

@moul
Copy link
Member

moul commented Jul 2, 2024

Opening this "good first issue" for anyone who wants to improve uassert and urequire. There are basically three ways to do it:

  1. Add missing helpers from https://github.com/stretchr/testify/blob/master/assert/assertions.go
  2. Improve the implementation (robustness, testing, code, error output rendering, support for new types, etc.)
  3. Update the existing examples/ packages to use uassert and urequire.

Edit:

  1. Enhance the gno test and stdlibs/testing functionality to display more information, such as line and column numbers, for better debugging. Or support the use of Sprintf() for structs with private fields, which is currently blocked for security concerns (in production), but could be beneficial for testing purposes.
@kazai777
Copy link
Contributor

kazai777 commented Jul 3, 2024

I've developed a part of testify assert in gno that would complete p/uassert, I was wondering if I should create a separate package or just add the functions and test to p/uassert?

@zivkovicmilos
Copy link
Member

@kazai777

You can definitely open up a PR against p/uassert 🙏

@kazai777
Copy link
Contributor

kazai777 commented Jul 8, 2024

@kazai777

You can definitely open up a PR against p/uassert 🙏

I just made a PR to add more functions to the p/uassert package

moul pushed a commit that referenced this issue Jul 14, 2024
… packages (#2491)

Related with #2481

This PR handles the following tasks:

1. Adds `NotEqual()` and `NotEmpty()` functions to the `p/demo/uassert`
and `p/demo/ urequire` packages (including unit tests)
2. Uses `p/demo/uassert` and `p/demo/urequire` packages for writing unit
tests for some demo packages at `examples/p/demo`
3. Todo : Do the same things with `examples/r/demo` (done)

<!-- 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>
gfanton pushed a commit to gfanton/gno that referenced this issue Jul 23, 2024
… packages (gnolang#2491)

Related with gnolang#2481

This PR handles the following tasks:

1. Adds `NotEqual()` and `NotEmpty()` functions to the `p/demo/uassert`
and `p/demo/ urequire` packages (including unit tests)
2. Uses `p/demo/uassert` and `p/demo/urequire` packages for writing unit
tests for some demo packages at `examples/p/demo`
3. Todo : Do the same things with `examples/r/demo` (done)

<!-- 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>
deelawn added a commit that referenced this issue Jul 23, 2024
# Description

Implement the [myers
algorithm](https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/)
to show the difference between two strings. related with #2481

simple demo https://play.gno.land/p/Veoxvg1xwUb

---------

Co-authored-by: Marc Vertes <[email protected]>
Co-authored-by: deelawn <[email protected]>
@wyhaines wyhaines added the hacktoberfest This might be a good issue for a hacktoberfest participant to handle. label Sep 30, 2024
@Kouteki Kouteki added help wanted Want to contribute? We recommend these issues. and removed help wanted labels Oct 2, 2024
@Kouteki Kouteki added this to the ⏭️Next after mainnet milestone Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗺️good first issue🗺️ Ideal for newcomer contributors hacktoberfest This might be a good issue for a hacktoberfest participant to handle. help wanted Want to contribute? We recommend these issues.
Projects
Status: 📥 Inbox
Status: Backlog
Development

No branches or pull requests

5 participants