Skip to content

Commit

Permalink
add ut test
Browse files Browse the repository at this point in the history
  • Loading branch information
mlycore committed Apr 13, 2018
1 parent 9a33308 commit c7b7f0b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gout/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main
import (
// "fmt"
)

func add(a, b int) int {
return a + b
}

func main() {
//...
}
13 changes: 13 additions & 0 deletions gout/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main
import (
"fmt"
"testing"
)

func Test_Add(t *testing.T) {
if 3 == add(1, 2) {
fmt.Println("ok")
}else {
fmt.Println("error")
}
}

0 comments on commit c7b7f0b

Please sign in to comment.