Skip to content

Commit

Permalink
fix current testcase expectation with gasUsed information
Browse files Browse the repository at this point in the history
  • Loading branch information
thinhnx-var committed Aug 11, 2024
1 parent 73bf52d commit 0cc91ce
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gnovm/cmd/gno/testdata/gno_test/error_correct.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gno test -v .
stdout 'Machine\.RunMain\(\) panic: oups'
stderr '=== RUN file/x_filetest.gno'
stderr '--- PASS: file/x_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'
stderr 'ok . total gas used: 0'

-- x_filetest.gno --
package main
Expand Down
3 changes: 2 additions & 1 deletion gnovm/cmd/gno/testdata/gno_test/minim2.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
gno test .

! stdout .+
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 11'

-- minim.gno --
package minim
Expand Down
3 changes: 2 additions & 1 deletion gnovm/cmd/gno/testdata/gno_test/minim3.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
gno test .

! stdout .+
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 10'

-- minim.gno --
package minim
Expand Down
3 changes: 2 additions & 1 deletion gnovm/cmd/gno/testdata/gno_test/output_correct.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gno test -v .
! stdout .+ # stdout should be empty
stderr '=== RUN file/x_filetest.gno'
stderr '--- PASS: file/x_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 28'

-- x_filetest.gno --
package main
Expand Down
3 changes: 2 additions & 1 deletion gnovm/cmd/gno/testdata/gno_test/output_sync.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gno test -v . -update-golden-tests
! stdout .+ # stdout should be empty
stderr '=== RUN file/x_filetest.gno'
stderr '--- PASS: file/x_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 28'

cmp x_filetest.gno x_filetest.gno.golden

Expand Down
3 changes: 2 additions & 1 deletion gnovm/cmd/gno/testdata/gno_test/realm_correct.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gno test -v .
! stdout .+ # stdout should be empty
stderr '=== RUN file/x_filetest.gno'
stderr '--- PASS: file/x_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 17'

-- x_filetest.gno --
// PKGPATH: gno.land/r/x
Expand Down
3 changes: 2 additions & 1 deletion gnovm/cmd/gno/testdata/gno_test/realm_sync.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ gno test -v . -update-golden-tests
! stdout .+ # stdout should be empty
stderr '=== RUN file/x_filetest.gno'
stderr '--- PASS: file/x_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 17'

cmp x_filetest.gno x_filetest.gno.golden

Expand Down
7 changes: 4 additions & 3 deletions gnovm/cmd/gno/testdata/gno_test/valid_filetest.txtar
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Test with a valid _filetest.gno file

# add the expectation of gasUsed information in stdout
gno test .

! stdout .+
stderr 'ok \. \d\.\d\ds'
stderr 'ok . total gas used: 19'

gno test -v .

! stdout .+
stderr '=== RUN file/valid_filetest.gno'
stderr '--- PASS: file/valid_filetest.gno \(\d\.\d\ds\)'
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 19'

-- valid.gno --
package valid
Expand Down
5 changes: 3 additions & 2 deletions gnovm/cmd/gno/testdata/gno_test/valid_test.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
gno test .

! stdout .+
stderr 'ok \. \d\.\d\ds'
# expected gasUsed information
stderr 'ok . total gas used: 353'

gno test ./...

! stdout .+
stderr 'ok \. \d\.\d\ds'
stderr 'ok . total gas used: 353'

-- valid.gno --
package valid
Expand Down

0 comments on commit 0cc91ce

Please sign in to comment.