feat: init update
This commit is contained in:
16
hello/hello_test.go
Normal file
16
hello/hello_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package hello
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"net/http/httptest"
|
||||
)
|
||||
|
||||
func TestHelloHandler(t *testing.T) {
|
||||
w := httptest.NewRecorder()
|
||||
req := httptest.NewRequest("GET", "/hello", nil)
|
||||
HelloHandler(w, req)
|
||||
expected := "Hello, World!"
|
||||
if w.Body.String() != expected {
|
||||
t.Errorf("Expected %q but got %q", expected, w.Body.String())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user