(t *testing.T)
| 173 | } |
| 174 | |
| 175 | func TestMarshalDeterministicIndent(t *testing.T) { |
| 176 | m := map[string]int{"b": 2, "a": 1} |
| 177 | |
| 178 | data, err := MarshalDeterministicIndent(m, "", " ") |
| 179 | if err != nil { |
| 180 | t.Fatalf("MarshalDeterministicIndent failed: %v", err) |
| 181 | } |
| 182 | |
| 183 | expected := "{\n \"a\": 1,\n \"b\": 2\n}" |
| 184 | if string(data) != expected { |
| 185 | t.Errorf("Expected:\n%s\nGot:\n%s", expected, string(data)) |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | func TestMarshalDeterministicToBuffer(t *testing.T) { |
| 190 | m := map[string]int{"b": 2, "a": 1} |
nothing calls this directly
no test coverage detected