first test for hello world
This commit is contained in:
commit
aa8ec804e9
11
hello.go
Normal file
11
hello.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func Hello() string {
|
||||||
|
return "Hello world"
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println(Hello())
|
||||||
|
}
|
11
hello_test.go
Normal file
11
hello_test.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestHello(t *testing.T) {
|
||||||
|
got := Hello()
|
||||||
|
exp := "Hello world"
|
||||||
|
if got != exp {
|
||||||
|
t.Errorf("got %q expected %q", got, exp)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user