test: add function testing case

This commit is contained in:
fatedier
2016-05-17 19:13:37 +08:00
parent d3c4401473
commit c680d87edc
10 changed files with 246 additions and 5 deletions

20
test/http_server.go Normal file
View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"net/http"
)
var (
PORT int64 = 10702
HTTP_RES_STR string = "Hello World"
)
func main() {
http.HandleFunc("/", request)
http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", PORT), nil)
}
func request(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(HTTP_RES_STR))
}