friendica-exporter/serverinfo/parse_test.go
2024-10-27 19:51:26 +01:00

28 lines
473 B
Go

package serverinfo
import (
"os"
"testing"
)
func TestParseJSON(t *testing.T) {
inputFiles := []string{
"stats.json",
}
for _, inputFile := range inputFiles {
inputFile := inputFile
t.Run(inputFile, func(t *testing.T) {
t.Parallel()
reader, err := os.Open("testdata/" + inputFile)
if err != nil {
t.Fatalf("error opening test data: %s", err)
}
if _, err := ParseJSON(reader); err != nil {
t.Errorf("got error %q", err)
}
})
}
}