forked from gnolang/gno
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(amino): panic when registering types with the same name (gnolang#…
…2325) This adds some doc and tests to `tm2/pkg/amino` to address the following in amino_test.go: fixed gnolang#2326 `// XXX Test registering duplicate names or concrete types not in a package.` - **chore(docs): document frequent functions in tm2/pkg/amino** - **chore(amino): add some tests** ## To run tests ``` cd tm2/pkg/amino go test -v --run=WithPanic\$ ``` Tests have uncovered a potential bug however in `TestDupNamesMustPanic`. Opening an issue now to document this, with a possible fix. ```go // The following does NOT panic, but it should. // assert.Panics(t, func() { // myPkg.WithTypes( // tests.EmptyStruct{}, "A", // tests.PrimitivesStruct{}, "B", // tests.ShortArraysStruct{}, "A", // Same name // ) // }) ``` <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [x] 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> --------- Co-authored-by: grepsuzette <grepsuzette@users.noreply.github.com> Co-authored-by: Morgan Bazalgette <morgan@morganbaz.com>
- Loading branch information
1 parent
f4324fb
commit e352770
Showing
4 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters