(t *testing.T)
| 114 | } |
| 115 | |
| 116 | func TestStructuredOutputGoldenSuccessOutputAudit(t *testing.T) { |
| 117 | fixtures := loadJSONGoldenSuccessOutputs(t) |
| 118 | examples := jsonGoldenSuccessOutputExamples() |
| 119 | |
| 120 | contractCommands := jsonContractCommandPathsWithVersion() |
| 121 | contractSet := make(map[string]bool, len(contractCommands)) |
| 122 | for _, command := range contractCommands { |
| 123 | contractSet[command] = true |
| 124 | } |
| 125 | |
| 126 | for _, command := range contractCommands { |
| 127 | fixture, ok := fixtures[command] |
| 128 | if !ok { |
| 129 | t.Errorf("JSON contract command %q has no golden success output", command) |
| 130 | continue |
| 131 | } |
| 132 | example, ok := examples[command] |
| 133 | if !ok { |
| 134 | t.Errorf("JSON contract command %q has no code-derived success output example", command) |
| 135 | continue |
| 136 | } |
| 137 | assertGoldenJSONEqual(t, command, fixture, example) |
| 138 | assertGoldenSuccessOutputStatuses(t, command, fixture) |
| 139 | } |
| 140 | for command := range fixtures { |
| 141 | if !contractSet[command] { |
| 142 | t.Errorf("golden success output includes non-contract command %q", command) |
| 143 | } |
| 144 | assertGoldenSuccessOutputStatuses(t, command, fixtures[command]) |
| 145 | } |
| 146 | for command := range examples { |
| 147 | if !contractSet[command] { |
| 148 | t.Errorf("code-derived success output example includes non-contract command %q", command) |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | func TestStructuredOutputGoldenErrorOutputAudit(t *testing.T) { |
| 154 | fixtures := loadJSONGoldenErrorOutputs(t) |
nothing calls this directly
no test coverage detected