(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestRegistryMarshallJSON(t *testing.T) { |
| 10 | b := &bytes.Buffer{} |
| 11 | enc := json.NewEncoder(b) |
| 12 | r := NewRegistry() |
| 13 | r.Register("counter", NewCounter()) |
| 14 | enc.Encode(r) |
| 15 | if s := b.String(); s != "{\"counter\":{\"count\":0}}\n" { |
| 16 | t.Fatalf(s) |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | func TestRegistryWriteJSONOnce(t *testing.T) { |
| 21 | r := NewRegistry() |
nothing calls this directly
no test coverage detected