Skip to content

Commit

Permalink
doc: unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jan 28, 2024
1 parent 1638b1f commit b52f84c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/classfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ func foo(v int) int {
Then you can create a `foo_test.gox` file to test it (see [unit-test/foo_test.gox](testdata/unit-test/foo_test.gox)):

```go
if v := foo(50); v == 100 {
t.log "test foo(50) ok"
if v := foo(50); v != 100 {
t.error "foo(50) ret: ${v}"
} else {
t.error "foo() ret: ${v}"
t.log "test foo(50) ok"
}

t.run "foo -10", t => {
Expand Down
6 changes: 3 additions & 3 deletions testdata/unit-test/foo_test.gox
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if v := foo(50); v == 100 {
t.log "test foo(50) ok"
if v := foo(50); v != 100 {
t.error "foo(50) ret: ${v}"
} else {
t.error "foo() ret: ${v}"
t.log "test foo(50) ok"
}

t.run "foo -10", t => {
Expand Down

0 comments on commit b52f84c

Please sign in to comment.