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

feat(examples): improve p/demo/ufmt #2553

Merged
merged 3 commits into from
Jul 22, 2024
Merged

Conversation

grepsuzette
Copy link
Contributor

@grepsuzette grepsuzette commented Jul 9, 2024

  • support for stringer, error
  • support for %c verb
  • allow to show value as in Go fmt.Sprintf
  • allow to show verb/type mismatches as in Go fmt.Sprintf
  • add some tests

@grepsuzette grepsuzette requested review from a team as code owners July 9, 2024 07:38
@grepsuzette grepsuzette requested review from ajnavarro and zivkovicmilos and removed request for a team July 9, 2024 07:38
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jul 9, 2024
grepsuzette added a commit to grepsuzette/gno that referenced this pull request Jul 9, 2024
- add p/demo/tictactoe (basically @moul's model gnolang#613)
- add p/demo/tictactoe1p (human VS cpu logic, extending the above)
- add p/demo/ternary (to cope w/ not having C `a ? b : c` ternary operator)
- add r/demo/games (start addressing gnolang#611)
- add r/demo/games/tictactoe

This last realm is a playable demo
against a parrot which, somehow learned
how to play Tic-tac-toe.

This is a stateless realm which uses gnoweb
as a webserver and uses css to offer a game-like
experience without javascript.

this depends on gnolang#2553 (improved ufmt)
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits

examples/gno.land/p/demo/ufmt/ufmt.gno Outdated Show resolved Hide resolved
examples/gno.land/p/demo/ufmt/ufmt.gno Show resolved Hide resolved
examples/gno.land/p/demo/ufmt/ufmt.gno Outdated Show resolved Hide resolved
examples/gno.land/p/demo/ufmt/ufmt.gno Show resolved Hide resolved
@grepsuzette
Copy link
Contributor Author

grepsuzette commented Jul 10, 2024

There's a failing test, line 1722 -> Draft:

Details

--- PASS: TestSprintf/unicode_formatting:_😊 (0.00s)
examples/gno.land/p/demo/ufmt: test pkg: panic: reflect: reflect.Value.SetString using value obtained using unexported field
stack:
goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.22.4/x64/src/runtime/debug/stack.go:24 +0x5e
main.runTestFiles.func1()
	/home/runner/work/gno/gno/gnovm/cmd/gno/test.go:427 +0x58
panic({0xd558c0?, 0xc0085c7ea0?})
	/opt/hostedtoolcache/go/1.22.4/x64/src/runtime/panic.go:770 +0x132
reflect.flag.mustBeAssignableSlow(0xc00ac88c88?)
	/opt/hostedtoolcache/go/1.22.4/x64/src/reflect/value.go:269 +0xb4
reflect.flag.mustBeAssignable(...)
	/opt/hostedtoolcache/go/1.22.4/x64/src/reflect/value.go:259
reflect.Value.SetString({0xd558c0?, 0xc0085c7e90?, 0x41cb38?}, {0xc004845ea9, 0x11})
	/opt/hostedtoolcache/go/1.22.4/x64/src/reflect/value.go:2526 +0x48
github.com/gnolang/gno/gnovm/pkg/gnolang.gno2GoValue(0xc0081110e0, {0xd558c0?, 0xc0085c7e90?, 0x0?})
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/gonative.go:1080 +0x44a
github.com/gnolang/gno/gnovm/pkg/gnolang.gno2GoValue(0xc00811d310, {0xc00806db00?, 0xc0085c7e90?, 0xc0085c7f80?})
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/gonative.go:1183 +0xb6f
github.com/gnolang/gno/gnovm/pkg/gnolang.gno2GoValue(0xc008111bc0, {0xd893e0?, 0xc0085c7e20?, 0xd477a0?})
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/gonative.go:1118 +0x985
github.com/gnolang/gno/gnovm/pkg/gnolang.gno2GoValue(0xc00869e9d8, {0xd477a0?, 0xc004492018?, 0x7f3d2ff01108?})
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/gonative.go:1164 +0xe85
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).doOpCallGoNative(0xc003c66908)
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/gonative.go:1417 +0x2e5
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).Run(0xc003c66908)
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/machine.go:1415 +0xaa5
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).Eval(0xc003c66908, {0x11208e0, 0xc00806d1a0})
	/home/runner/work/gno/gno/gnovm/pkg/gnolang/machine.go:794 +0x63c
main.runTestFiles(0xc003c66908, 0xc000012498, {0xc002bca4c8, 0x4}, 0x1, 0x0, {0x0, 0x0}, {0x11238b0, 0xc0003cb6d0})
	/home/runner/work/gno/gno/gnovm/cmd/gno/test.go:453 +0x3a5
main.gnoTestPkg({0xc0003f8db0, 0x1d}, {0xc000412c20?, 0x1, 0x0?}, {0x0, 0x0, 0xab4a825700000000?}, 0xc000399ac0, {0x11238b0, ...})
	/home/runner/work/gno/gno/gnovm/cmd/gno/test.go:298 +0x12bf
main.execTest(0xc000399ac0, {0xc0003c4ed0?, 0x1?, 0x1?}, {0x11238b0, 0xc0003cb6d0})
	/home/runner/work/gno/gno/gnovm/cmd/gno/test.go:197 +0x428
main.newTestCmd.func1({0x0?, 0xc000112070?}, {0xc0003c4ed0?, 0xc000394600?, 0x0?})
	/home/runner/work/gno/gno/gnovm/cmd/gno/test.go:98 +0x30
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0xc00032bea8?, {0x11164b0?, 0x180e980?})
	/home/runner/work/gno/gno/tm2/pkg/commands/command.go:255 +0x19d
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0xc0003c2dc0?, {0x11164b0?, 0x180e980?})
	/home/runner/work/gno/gno/tm2/pkg/commands/command.go:259 +0x149
github.com/gnolang/gno/tm2/pkg/commands.(*Command).ParseAndRun(0xc0003c2dc0, {0x11164b0, 0x180e980}, {0xc000112050?, 0xc0003c3340?, 0xc0003c33f0?})
	/home/runner/work/gno/gno/tm2/pkg/commands/command.go:140 +0x49
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Execute(0x11238b0?, {0x11164b0?, 0x180e980?}, {0xc000112050?, 0x172fcc8?, 0xc0000061c0?})
	/home/runner/work/gno/gno/tm2/pkg/commands/command.go:117 +0x2c
main.main()
	/home/runner/work/gno/gno/gnovm/cmd/gno/main.go:13 +0x5f

gno machine: Machine:
    CheckTypes: false
    Op: [OpHalt OpBody OpRangeIter OpPopBlock OpBody OpReturn OpBody OpPopResults OpExec OpBody OpPopResults OpExec OpBody OpRangeIter OpDefine]
    Values: (len: 6)
          #5 (slice[(struct{("hello %s!" string),(slice[("planet" string)] []interface{}),("hello planet!" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("hi %%%s!" string),(slice[("worl%d" string)] []interface{}),("hi %worl%d!" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s %c %d %t" string),(slice[("foo" string),(945 int32),(421 int),(true bool)] []interface{}),("foo α 421 true" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("string [%s]" string),(slice[("foo" string)] []interface{}),("string [foo]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int [%d]" string),(slice[(42 int)] []interface{}),("int [42]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int8 [%d]" string),(slice[(8 int8)] []interface{}),("int8 [8]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int16 [%d]" string),(slice[(16 int16)] []interface{}),("int16 [16]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int32 [%d]" string),(slice[(32 int32)] []interface{}),("int32 [32]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int64 [%d]" string),(slice[(64 int64)] []interface{}),("int64 [64]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint [%d]" string),(slice[(42 uint)] []interface{}),("uint [42]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint8 [%d]" string),(slice[(8 uint8)] []interface{}),("uint8 [8]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint16 [%d]" string),(slice[(16 uint16)] []interface{}),("uint16 [16]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint32 [%d]" string),(slice[(32 uint32)] []interface{}),("uint32 [32]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint64 [%d]" string),(slice[(64 uint64)] []interface{}),("uint64 [64]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("bool [%t]" string),(slice[(true bool)] []interface{}),("bool [true]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("bool [%t]" string),(slice[(false bool)] []interface{}),("bool [false]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("no args" string),(nil []interface{}),("no args" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("finish with %" string),(nil []interface{}),("finish with %" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("stringer [%s]" string),(slice[(struct{} gno.land/p/demo/ufmt.stringer)] []interface{}),("stringer [I'm a stringer]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("â" string),(nil []interface{}),("â" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("Hello, World! 😊" string),(nil []interface{}),("Hello, World! 😊" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("unicode formatting: %s" string),(slice[("😊" string)] []interface{}),("unicode formatting: 😊" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("error: %s" string),(slice[(&(struct{("can I be printed?" string)} errors.errorString) *errors.errorString)] []interface{}),("error: can I be printed?" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(undefined)] []interface{}),("%!s(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(421 int)] []interface{}),("%!s(int=421)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[("z" string)] []interface{}),("z" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(true bool)] []interface{}),("%!s(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(122 int32)] []interface{}),("%!s(int32=122)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(undefined)] []interface{}),("%!c(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(421 int)] []interface{}),("ƥ" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[("z" string)] []interface{}),("%!c(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(true bool)] []interface{}),("%!c(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(122 int32)] []interface{}),("z" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(undefined)] []interface{}),("%!d(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(421 int)] []interface{}),("421" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[("z" string)] []interface{}),("%!d(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(true bool)] []interface{}),("%!d(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(122 int32)] []interface{}),("122" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(undefined)] []interface{}),("%!t(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(421 int)] []interface{}),("%!t(int=421)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[("z" string)] []interface{}),("%!t(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(true bool)] []interface{}),("true" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(122 int32)] []interface{}),("%!t(int32=122)" string)} struct{format string;values []interface{};expectedOutput string})] []struct{format string;values []interface{};expectedOutput string})
          #4 (TestSprintf testing.testingFunc)
          #3 (tRunner func(t *testing.T,fn testing.testingFunc,verbose bool)())
          #2 (RunTest func(runFlag string,verbose bool,test testing.InternalTest)(ret string))
          #1 (slice[(struct{("TestSprintf" string),(TestSprintf testing.testingFunc)} testing.InternalTest),(struct{("TestErrorf" string),(TestErrorf testing.testingFunc)} testing.InternalTest),(struct{("TestPrintln" string),(TestPrintln testing.testingFunc)} testing.InternalTest)] []testing.InternalTest)
          #0 (runtest func(name string)(report string))
    Exprs:
    Stmts:
          #8 bodyStmt[43/22/1]=t<VPBlock(2,0)>.Run(name<VPBlock(1,1)>, (const-type testing.testingFunc)(func func(t *(testing<VPBlock(3,2)>.T)){ got<VPBlock(1,1)> := Sprintf<VPBlock(5,1)>(tc<VPBlock(2,0)>.format, tc<VPBlock(2,0)>.values...); if got<VPBlock(2,1)> != tc<VPBlock(3,0)>.expectedOutput { t<VPBlock(2,0)>.Errorf((const ("got %q, want %q." string)), got<VPBlock(2,1)>, tc<VPBlock(3,0)>.expectedOutput) } }))*
          #7 bodyStmt[0/0/4]=(end)
          #6 return
          #5 bodyStmt[0/0/5]=(end)
          #4 return
          #3 bodyStmt[0/0/3]=if !t<VPBlock(2,4)>.verbose && t<VPBlock(2,4)>.Failed() { t<VPBlock(2,4)>.printFailure() }
          #2 bodyStmt[0/0/1]=(end)
          #1 bodyStmt[3/0/1]=(end)
          #0 bodyStmt[0/0/1]=panic((const ("no such test: " string)) + name<VPBlock(1,0)>)*
    Blocks:
          @(2770) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc008122d20,Source:for _<VPBlock(0,0)>, tc<VPBlock(...,Parent:0xc008122960)
            tc: (struct{("error: %s" string),(slice[(&(struct{("can I be printed?" string)} errors.errorString) *errors.errorString)] []interface{}),("error: can I be printed?" string)} struct{format string;values []interface{};expectedOutput string})
            name: ("unicode formatting: 😊" string)
 (s vals) @(2770) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc007f8b1b0,Source:for _<VPBlock(0,0)>, tc<VPBlock(...,Parent:0xc007fbc030)
            tc: (nil struct{format string;values []interface{};expectedOutput string})
            name: ( string)
 (s typs) @(2770) [struct{format string;values []interface{};expectedOutput string} string]
          @(3042) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc008122960,Source:func TestSprintf(t *(testing<VPB...,Parent:0xc0080c2f00)
            t: (&(struct{("TestSprintf" string),(false bool),(false bool),(slice[(&(struct{("TestSprintf/hello_planet!" string),(false bool),(false bool),(nil []*testing.T),(0xc0086f9590 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/hi_%worl%d!" string),(false bool),(false bool),(nil []*testing.T),(0xc0086f9800 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/foo_α_421_true" string),(false bool),(false bool),(nil []*testing.T),(0xc0086f9a70 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/string_[foo]" string),(false bool),(false bool),(nil []*testing.T),(0xc0086f9ce0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc0086f9f50 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008794240 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc0087944b0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008794720 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008794990 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008794c00 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008794e70 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc0087950e0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008795350 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc0087955c0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[true]" string),(false bool),(false bool),(nil []*testing.T),(0xc008795830 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[false]" string),(false bool),(false bool),(nil []*testing.T),(0xc008795aa0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/no_args" string),(false bool),(false bool),(nil []*testing.T),(0xc008795d10 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/finish_with_%!(NOVERB)" string),(false bool),(false bool),(nil []*testing.T),(0xc0087a8000 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/stringer_[{}]" string),(false bool),(false bool),(nil []*testing.T),(0xc0087a8270 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/â" string),(false bool),(false bool),(nil []*testing.T),(0xc0087a84e0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/Hello,_World!_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc0087a8750 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/unicode_formatting:_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc0087a89c0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T)] []*testing.T),(nil *testing.T),(nil []uint8),(true bool),(undefined),( string)} testing.T) *testing.T)
            errorToBePrinted: (&(struct{("can I be printed?" string)} errors.errorString) *errors.errorString)
            tru: (true bool)
            cases: (slice[(struct{("hello %s!" string),(slice[("planet" string)] []interface{}),("hello planet!" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("hi %%%s!" string),(slice[("worl%d" string)] []interface{}),("hi %worl%d!" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s %c %d %t" string),(slice[("foo" string),(945 int32),(421 int),(true bool)] []interface{}),("foo α 421 true" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("string [%s]" string),(slice[("foo" string)] []interface{}),("string [foo]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int [%d]" string),(slice[(42 int)] []interface{}),("int [42]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int8 [%d]" string),(slice[(8 int8)] []interface{}),("int8 [8]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int16 [%d]" string),(slice[(16 int16)] []interface{}),("int16 [16]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int32 [%d]" string),(slice[(32 int32)] []interface{}),("int32 [32]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int64 [%d]" string),(slice[(64 int64)] []interface{}),("int64 [64]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint [%d]" string),(slice[(42 uint)] []interface{}),("uint [42]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint8 [%d]" string),(slice[(8 uint8)] []interface{}),("uint8 [8]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint16 [%d]" string),(slice[(16 uint16)] []interface{}),("uint16 [16]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint32 [%d]" string),(slice[(32 uint32)] []interface{}),("uint32 [32]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint64 [%d]" string),(slice[(64 uint64)] []interface{}),("uint64 [64]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("bool [%t]" string),(slice[(true bool)] []interface{}),("bool [true]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("bool [%t]" string),(slice[(false bool)] []interface{}),("bool [false]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("no args" string),(nil []interface{}),("no args" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("finish with %" string),(nil []interface{}),("finish with %" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("stringer [%s]" string),(slice[(struct{} gno.land/p/demo/ufmt.stringer)] []interface{}),("stringer [I'm a stringer]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("â" string),(nil []interface{}),("â" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("Hello, World! 😊" string),(nil []interface{}),("Hello, World! 😊" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("unicode formatting: %s" string),(slice[("😊" string)] []interface{}),("unicode formatting: 😊" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("error: %s" string),(slice[(&(struct{("can I be printed?" string)} errors.errorString) *errors.errorString)] []interface{}),("error: can I be printed?" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(undefined)] []interface{}),("%!s(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(421 int)] []interface{}),("%!s(int=421)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[("z" string)] []interface{}),("z" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(true bool)] []interface{}),("%!s(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(122 int32)] []interface{}),("%!s(int32=122)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(undefined)] []interface{}),("%!c(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(421 int)] []interface{}),("ƥ" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[("z" string)] []interface{}),("%!c(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(true bool)] []interface{}),("%!c(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(122 int32)] []interface{}),("z" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(undefined)] []interface{}),("%!d(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(421 int)] []interface{}),("421" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[("z" string)] []interface{}),("%!d(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(true bool)] []interface{}),("%!d(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(122 int32)] []interface{}),("122" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(undefined)] []interface{}),("%!t(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(421 int)] []interface{}),("%!t(int=421)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[("z" string)] []interface{}),("%!t(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(true bool)] []interface{}),("true" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(122 int32)] []interface{}),("%!t(int32=122)" string)} struct{format string;values []interface{};expectedOutput string})] []struct{format string;values []interface{};expectedOutput string})
 (s vals) @(3042) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc007fbc030,Source:func TestSprintf(t *(testing<VPB...,Parent:0xc0092f5230)
            t: (nil *testing.T)
            errorToBePrinted: (undefined)
            tru: (false bool)
            cases: (nil []struct{format string;values []interface{};expectedOutput string})
 (s typs) @(3042) [*testing.T .uverse.error bool []struct{format string;values []interface{};expectedOutput string}]
          @(7020) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc0080c2f00,Source:file{ package ufmt; import error...,Parent:0xc007f4d860)
            errors: (package(errors errors) package{})
            fmt: (package(fmt fmt) package{})
            testing: (package(testing testing) package{})
 (s vals) @(7020) Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc0092f5230,Source:file{ package ufmt; import error...,Parent:0xc0011b2c30)
            errors: (package(errors errors) package{})
            fmt: (package(fmt fmt) package{})
            testing: (package(testing testing) package{})
 (s typs) @(7020) [package{} package{} package{}]
          @(7244) gno.land/p/demo/ufmt
    Blocks (other):
          #6 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc008122960,Source:func TestSprintf(t *(testing<VPB...,Parent:0xc0080c2f00)
            t: (&(struct{("TestSprintf" string),(false bool),(false bool),(slice[(&(struct{("TestSprintf/hello_planet!" string),(false bool),(false bool),(nil []*testing.T),(0xc008af7800 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/hi_%worl%d!" string),(false bool),(false bool),(nil []*testing.T),(0xc008af7a70 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/foo_α_421_true" string),(false bool),(false bool),(nil []*testing.T),(0xc008af7ce0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/string_[foo]" string),(false bool),(false bool),(nil []*testing.T),(0xc008af7f50 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc4240 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc44b0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc4720 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc4990 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc4c00 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc4e70 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc50e0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc5350 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc55c0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc5830 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[true]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc5aa0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[false]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc5d10 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/no_args" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc8000 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/finish_with_%!(NOVERB)" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc8270 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/stringer_[{}]" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc84e0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/â" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc8750 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/Hello,_World!_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc89c0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/unicode_formatting:_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc008cc8c30 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T)] []*testing.T),(nil *testing.T),(nil []uint8),(true bool),(undefined),( string)} testing.T) *testing.T)
            errorToBePrinted: (&(struct{("can I be printed?" string)} errors.errorString) *errors.errorString)
            tru: (true bool)
            cases: (slice[(struct{("hello %s!" string),(slice[("planet" string)] []interface{}),("hello planet!" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("hi %%%s!" string),(slice[("worl%d" string)] []interface{}),("hi %worl%d!" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s %c %d %t" string),(slice[("foo" string),(945 int32),(421 int),(true bool)] []interface{}),("foo α 421 true" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("string [%s]" string),(slice[("foo" string)] []interface{}),("string [foo]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int [%d]" string),(slice[(42 int)] []interface{}),("int [42]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int8 [%d]" string),(slice[(8 int8)] []interface{}),("int8 [8]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int16 [%d]" string),(slice[(16 int16)] []interface{}),("int16 [16]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int32 [%d]" string),(slice[(32 int32)] []interface{}),("int32 [32]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("int64 [%d]" string),(slice[(64 int64)] []interface{}),("int64 [64]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint [%d]" string),(slice[(42 uint)] []interface{}),("uint [42]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint8 [%d]" string),(slice[(8 uint8)] []interface{}),("uint8 [8]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint16 [%d]" string),(slice[(16 uint16)] []interface{}),("uint16 [16]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint32 [%d]" string),(slice[(32 uint32)] []interface{}),("uint32 [32]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("uint64 [%d]" string),(slice[(64 uint64)] []interface{}),("uint64 [64]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("bool [%t]" string),(slice[(true bool)] []interface{}),("bool [true]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("bool [%t]" string),(slice[(false bool)] []interface{}),("bool [false]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("no args" string),(nil []interface{}),("no args" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("finish with %" string),(nil []interface{}),("finish with %" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("stringer [%s]" string),(slice[(struct{} gno.land/p/demo/ufmt.stringer)] []interface{}),("stringer [I'm a stringer]" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("â" string),(nil []interface{}),("â" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("Hello, World! 😊" string),(nil []interface{}),("Hello, World! 😊" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("unicode formatting: %s" string),(slice[("😊" string)] []interface{}),("unicode formatting: 😊" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("error: %s" string),(slice[(&(struct{("can I be printed?" string)} errors.errorString) *errors.errorString)] []interface{}),("error: can I be printed?" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(undefined)] []interface{}),("%!s(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(421 int)] []interface{}),("%!s(int=421)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[("z" string)] []interface{}),("z" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(true bool)] []interface{}),("%!s(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%s" string),(slice[(122 int32)] []interface{}),("%!s(int32=122)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(undefined)] []interface{}),("%!c(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(421 int)] []interface{}),("ƥ" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[("z" string)] []interface{}),("%!c(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(true bool)] []interface{}),("%!c(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%c" string),(slice[(122 int32)] []interface{}),("z" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(undefined)] []interface{}),("%!d(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(421 int)] []interface{}),("421" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[("z" string)] []interface{}),("%!d(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(true bool)] []interface{}),("%!d(bool=true)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%d" string),(slice[(122 int32)] []interface{}),("122" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(undefined)] []interface{}),("%!t(<nil>)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(421 int)] []interface{}),("%!t(int=421)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[("z" string)] []interface{}),("%!t(string=z)" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(true bool)] []interface{}),("true" string)} struct{format string;values []interface{};expectedOutput string}),(struct{("%t" string),(slice[(122 int32)] []interface{}),("%!t(int32=122)" string)} struct{format string;values []interface{};expectedOutput string})] []struct{format string;values []interface{};expectedOutput string})
 (static) #6 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc007fbc030,Source:func TestSprintf(t *(testing<VPB...,Parent:0xc0092f5230)
            t: (nil *testing.T)
            errorToBePrinted: (undefined)
            tru: (false bool)
            cases: (nil []struct{format string;values []interface{};expectedOutput string})
          #5 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00811bc20,Source:func tRunner(t *(T<VPBlock(2,35)...,Parent:0xc007ca7680)
            t: (&(struct{("TestSprintf" string),(false bool),(false bool),(slice[(&(struct{("TestSprintf/hello_planet!" string),(false bool),(false bool),(nil []*testing.T),(0xc008d3de90 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/hi_%worl%d!" string),(false bool),(false bool),(nil []*testing.T),(0xc008f18180 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/foo_α_421_true" string),(false bool),(false bool),(nil []*testing.T),(0xc008f183f0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/string_[foo]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f18660 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f188d0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f18b40 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f18db0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f19020 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f19290 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f19500 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f19770 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f199e0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f19c50 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f19ec0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[true]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1c1b0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[false]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1c420 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/no_args" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1c690 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/finish_with_%!(NOVERB)" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1c900 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/stringer_[{}]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1cb70 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/â" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1cde0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/Hello,_World!_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1d050 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/unicode_formatting:_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1d2c0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T)] []*testing.T),(nil *testing.T),(nil []uint8),(true bool),(undefined),( string)} testing.T) *testing.T)
            fn: (TestSprintf testing.testingFunc)
            verbose: (true bool)
            start: (1720596723444526193 int64)
 (static) #5 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00356e830,Source:func tRunner(t *(T<VPBlock(2,35)...,Parent:0xc004477b30)
            t: (nil *testing.T)
            fn: (nil testing.testingFunc)
            verbose: (false bool)
            start: (0 int64)
          #4 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00811b860,Source:func RunTest(runFlag (const-type...,Parent:0xc007ca7680)
            runFlag: ("" string)
            verbose: (true bool)
            test: (struct{("TestSprintf" string),(TestSprintf testing.testingFunc)} testing.InternalTest)
            ret: ( string)
            t: (&(struct{("TestSprintf" string),(false bool),(false bool),(slice[(&(struct{("TestSprintf/hello_planet!" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1db90 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/hi_%worl%d!" string),(false bool),(false bool),(nil []*testing.T),(0xc008f1de00 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/foo_α_421_true" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4e0f0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/string_[foo]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4e360 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4e5d0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4e840 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4eab0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4ed20 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/int64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4ef90 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint_[42]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4f200 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint8_[8]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4f470 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint16_[16]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4f6e0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint32_[32]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4f950 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/uint64_[64]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4fbc0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[true]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f4fe30 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/bool_[false]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70120 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/no_args" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70390 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/finish_with_%!(NOVERB)" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70600 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/stringer_[{}]" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70870 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/â" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70ae0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/Hello,_World!_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70d50 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T),(&(struct{("TestSprintf/unicode_formatting:_😊" string),(false bool),(false bool),(nil []*testing.T),(0xc008f70fc0 *testing.T),(nil []uint8),(true bool),(undefined),("0.00s" string)} testing.T) *testing.T)] []*testing.T),(nil *testing.T),(nil []uint8),(true bool),(undefined),( string)} testing.T) *testing.T)
            report: (undefined)
            out: (undefined)
 (static) #4 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00354fc30,Source:func RunTest(runFlag (const-type...,Parent:0xc004477b30)
            runFlag: ( string)
            verbose: (false bool)
            test: (nil testing.InternalTest)
            ret: ( string)
            t: (nil *testing.T)
            report: (nil testing.Report)
            out: (nil gonative{[]uint8})
          #3 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00811b680,Source:if test<VPBlock(2,0)>.Name == na...,Parent:0xc00811b4a0)
 (static) #3 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc009bf0430,Source:if test<VPBlock(2,0)>.Name == na...,Parent:0xc003be6e30)
          #2 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00811b4a0,Source:for _<VPBlock(0,0)>, test<VPBloc...,Parent:0xc00811b2c0)
            test: (struct{("TestSprintf" string),(TestSprintf testing.testingFunc)} testing.InternalTest)
 (static) #2 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc003be6e30,Source:for _<VPBlock(0,0)>, test<VPBloc...,Parent:0xc0013bcc30)
            test: (nil testing.InternalTest)
          #1 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc00811b2c0,Source:func runtest(name (const-type st...,Parent:0xc00811ab40)
            name: ("TestSprintf" string)
            report: ( string)
 (static) #1 Block(ID:0000000000000000000000000000000000000000:0,Addr:0xc0013bcc30,Source:func runtest(name (const-type st...,Parent:0xc0039a1530)
            name: ( string)
            report: ( string)
    Frames:
          #6 [FRAME GOFUNC:0x502e40 RECV:(undefined) (2 args) 15/6/0/9/8]
          #5 [FRAME LABEL:  13/5/0/8/7]
          #4 [FRAME FUNC:TestSprintf RECV:(undefined) (1 args) 11/4/0/6/6 LASTPKG:testing LASTRLM:Realm(nil)]
          #3 [FRAME FUNC:tRunner RECV:(undefined) (3 args) 8/3/0/4/5 LASTPKG:testing LASTRLM:Realm(nil)]
          #2 [FRAME FUNC:RunTest RECV:(undefined) (3 args) 6/2/0/3/4 LASTPKG:gno.land/p/demo/ufmt LASTRLM:Realm(nil)]
          #1 [FRAME LABEL:  2/1/0/1/2]
          #0 [FRAME FUNC:runtest RECV:(undefined) (1 args) 1/0/0/0/1 LASTPKG:gno.land/p/demo/ufmt LASTRLM:Realm(nil)]
    Exceptions:

FAIL
FAIL    examples/gno.land/p/demo/ufmt 	1.45s
FAIL

@grepsuzette grepsuzette marked this pull request as draft July 10, 2024 07:45
@grepsuzette grepsuzette force-pushed the improve_ufmt branch 4 times, most recently from ccdead5 to deeee75 Compare July 10, 2024 11:49
* support for stringer, error
* support for %c verb
* allow to show <nil> value as in Go fmt.Sprintf
* allow to show verb/type mismatches as in Go fmt.Sprintf
* add tests
This line
// {"error: %s", []interface{}{errorToBePrinted}, "error: can I be printed?"},

gave panic: reflect: reflect.Value.SetString using value obtained using unexported field

Seems to have to do with the for loop using []interface{} and
what was being done in the body of the for.

in gnovm/stdlibs/error, exporting s in errorString fixed the error:

type errorString struct { S /* <- this */ string }

But moved the test in its own function, this passes:

```
func TestPrintErrors(t *testing.T) {
got := Sprintf("error: %s", errors.New("can I be printed?"))
expectedOutput := "error: can I be printed?"
if got != expectedOutput {
    t.Errorf("got %q, want %q.", got, expectedOutput)
}
}
```
@grepsuzette grepsuzette marked this pull request as ready for review July 10, 2024 23:48
@ajnavarro ajnavarro merged commit fa98780 into gnolang:master Jul 22, 2024
9 checks passed
gfanton pushed a commit to gfanton/gno that referenced this pull request Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants