| 1 | package serverinfoscip-go gomod github.com/xperimental/nextcloud-exporter . `github.com/xperimental/nextcloud-exporter/serverinfo`/ |
| 2 | |
| 3 | import ( |
| 4 | "osscip-go gomod github.com/golang/go/src go1.23 os/" |
| 5 | "testingscip-go gomod github.com/golang/go/src go1.23 testing/" |
| 6 | ) |
| 7 | |
| 8 | func TestParseJSONscip-go gomod github.com/xperimental/nextcloud-exporter . `github.com/xperimental/nextcloud-exporter/serverinfo`/TestParseJSON().(t *testingscip-go gomod github.com/golang/go/src go1.23 testing/.Tscip-go gomod github.com/golang/go/src go1.23 testing/T#) { |
| 9 | inputFiles := []string{ |
| 10 | "info.json", |
| 11 | "negative-space.json", |
| 12 | "na-values.json", |
| 13 | "nc22.json", |
| 14 | "large-freespace.json", |
| 15 | } |
| 16 | |
| 17 | for _, inputFile := range inputFiles { |
| 18 | inputFile := inputFile |
| 19 | t.Runscip-go gomod github.com/golang/go/src go1.23 testing/T#Run().(inputFile, func(t *testingscip-go gomod github.com/golang/go/src go1.23 testing/.Tscip-go gomod github.com/golang/go/src go1.23 testing/T#) { |
| 20 | t.Parallelscip-go gomod github.com/golang/go/src go1.23 testing/T#Parallel().() |
| 21 | |
| 22 | reader, err := osscip-go gomod github.com/golang/go/src go1.23 os/.Openscip-go gomod github.com/golang/go/src go1.23 os/Open().("testdata/" + inputFile) |
| 23 | if err != nil { |
| 24 | t.Fatalfscip-go gomod github.com/golang/go/src go1.23 testing/common#Fatalf().("error opening test data: %s", err) |
| 25 | } |
| 26 | |
| 27 | if _, err := ParseJSONscip-go gomod github.com/xperimental/nextcloud-exporter . `github.com/xperimental/nextcloud-exporter/serverinfo`/ParseJSON().(reader); err != nil { |
| 28 | t.Errorfscip-go gomod github.com/golang/go/src go1.23 testing/common#Errorf().("got error %q", err) |
| 29 | } |
| 30 | }) |
| 31 | } |
| 32 | } |