initial
This commit is contained in:
26
testfunc_test.go
Normal file
26
testfunc_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestHello(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "basic test - returns correct greeting",
|
||||
want: "Hello go",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := hello()
|
||||
require.Equal(t, tt.want, got, "hello() should return expected string")
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user