Skip to content

Commit

Permalink
style: remove a2u helper
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Jul 19, 2023
1 parent dfb2bed commit 8340928
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions examples/gno.land/r/demo/foo20/foo20_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,15 @@ func TestErrConditions(t *testing.T) {
std.TestSetOrigCaller(admin)
{
tests := []test{
{"Transfer(admin, 1)", "cannot send transfer to self", func() { Transfer(a2u(admin), 1) }},
{"Approve(empty, 1))", "invalid address", func() { Approve(a2u(empty), 1) }},
{"Transfer(admin, 1)", "cannot send transfer to self", func() { Transfer(users.AddressOrName(admin), 1) }},
{"Approve(empty, 1))", "invalid address", func() { Approve(users.AddressOrName(empty), 1) }},
}
for _, tc := range tests {
shouldPanicWithMsg(t, tc.fn, tc.msg)
}
}
}

func a2u(addr std.Address) users.AddressOrName {
return users.AddressOrName(addr)
}

func shouldPanicWithMsg(t *testing.T, f func(), msg string) {
defer func() {
if r := recover(); r == nil {
Expand Down

0 comments on commit 8340928

Please sign in to comment.