(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestEncodeDeterministic(t *testing.T) { |
| 94 | for _, a := range []Artifact{samplePlaybook(), sampleConvention()} { |
| 95 | first, err := Encode(a) |
| 96 | if err != nil { |
| 97 | t.Fatalf("Encode 1: %v", err) |
| 98 | } |
| 99 | second, err := Encode(a) |
| 100 | if err != nil { |
| 101 | t.Fatalf("Encode 2: %v", err) |
| 102 | } |
| 103 | if !bytes.Equal(first, second) { |
| 104 | t.Errorf("Encode not deterministic for %s:\n%s\nvs\n%s", a.Kind, first, second) |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | func TestEncodeUnknownKind(t *testing.T) { |
| 110 | _, err := Encode(Artifact{Kind: "nonsense"}) |
nothing calls this directly
no test coverage detected