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

Wrapped AssertOriginCall panics in tests #3408

Open
n0izn0iz opened this issue Dec 26, 2024 · 0 comments
Open

Wrapped AssertOriginCall panics in tests #3408

n0izn0iz opened this issue Dec 26, 2024 · 0 comments
Labels
🐞 bug Something isn't working

Comments

@n0izn0iz
Copy link
Contributor

n0izn0iz commented Dec 26, 2024

Wrapped AssertOriginCall panics in tests

Your environment

  • go version go1.23.4
  • darwin/arm64
  • Gno ea32315

Steps to reproduce

Run this test:

package wrappedtestpanicorigcall

import (
	"std"
	"testing"

	"gno.land/p/demo/urequire"
)

func TestFoo(t *testing.T) {
	std.AssertOriginCall() // does not panic, expected

	urequire.NotPanics(t, func() {
		std.AssertOriginCall() // panics while it should not
	})
}

You can find a branch with it here

Expected behaviour

The test passes

Actual behaviour

The test fails

Logs

> gno test ./gno.land/r/demo/wrappedtestpanicorigcall

panic: invalid non-origin call
--- FAIL: TestFoo (0.00s)
./gno.land/r/demo/wrappedtestpanicorigcall: test pkg: failed: "TestFoo"
FAIL
FAIL    ./gno.land/r/demo/wrappedtestpanicorigcall 	0.62s
FAIL
FAIL
FAIL: 0 build errors, 1 test errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
Status: Triage
Development

No branches or pull requests

1 participant