You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
fixedgnolang#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 <[email protected]>
Co-authored-by: Morgan Bazalgette <[email protected]>
0 commit comments