-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gnovm): enable debugger for gno test (#3380)
This change brings interactive debugging to gno tests, using -debug flag. New debugger commands have also been added: - next, to step over the next source line - stepout, to step out of the current function Usage example, from the clone root dir: ```console $ go run ./gnovm/cmd/gno test -v -debug ./examples/gno.land/p/demo/diff -run TestMyersDiff/Case_sensitivity Welcome to the Gnovm debugger. Type 'help' for list of commands. dbg> break gno.land/p/demo/diff/diff.gno:60 Breakpoint 0 at gno.land/p/demo/diff gno.land/p/demo/diff/diff.gno:60:0 dbg> c === RUN TestMyersDiff === RUN TestMyersDiff/Case_sensitivity > diff.MyersDiff() gno.land/p/demo/diff/diff.gno:60:10 55: // 56: // Returns: 57: // - A slice of Edit operations representing the minimum difference between the two strings. 58: func MyersDiff(old, new string) []Edit { 59: oldRunes, newRunes := []rune(old), []rune(new) => 60: n, m := len(oldRunes), len(newRunes) 61: 62: if n == 0 && m == 0 { 63: return []Edit{} 64: } dbg> p oldRunes (slice[(97 int32),(98 int32),(99 int32)] []int32) dbg> stack 0 in gno.land/p/demo/diff.MyersDiff at gno.land/p/demo/diff/diff.gno:60:10 1 in gno.land/p/demo/diff. at gno.land/p/demo/diff/diff_test.gno:176:4 2 in testing.tRunner at testing/testing.gno:364:2 3 in testing.(*testing.T).Run at testing/testing.gno:171:2 4 in gno.land/p/demo/diff.TestMyersDiff at gno.land/p/demo/diff/diff_test.gno:175:3 5 in testing.tRunner at testing/testing.gno:364:2 6 in testing.RunTest at testing/testing.gno:298:2 dbg> ```
- Loading branch information
Showing
7 changed files
with
125 additions
and
28 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
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