Tests: Go application tests.

This commit is contained in:
Andrey Zelenkov
2018-06-08 18:32:55 +03:00
parent 2b39ed5dfb
commit f2a856aa3b
11 changed files with 377 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
package main
import (
"io"
"os"
"fmt"
"strings"
"net/http"
"nginx/unit"
)
func handler(w http.ResponseWriter, r *http.Request) {
args := strings.Join(os.Args[1:], ",")
w.Header().Add("X-Arg-0", fmt.Sprintf("%v", os.Args[0]))
w.Header().Add("Content-Length", fmt.Sprintf("%v", len(args)))
io.WriteString(w, args)
}
func main() {
http.HandleFunc("/", handler)
unit.ListenAndServe(":7080", nil)
}