(t *testing.T)
| 133 | } |
| 134 | |
| 135 | func TestCheckForUpdate_BadJSON(t *testing.T) { |
| 136 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 137 | w.Write([]byte("not json")) |
| 138 | })) |
| 139 | defer srv.Close() |
| 140 | |
| 141 | _, err := CheckForUpdate("0.5.0", Options{ReleasesURL: srv.URL}) |
| 142 | if err == nil { |
| 143 | t.Error("expected error for bad JSON") |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func TestNormalizeVersion(t *testing.T) { |
| 148 | tests := []struct { |
nothing calls this directly
no test coverage detected