Finding #6: multiple format flags resolve last-wins instead of erroring.
(t *testing.T)
| 195 | |
| 196 | // Finding #6: multiple format flags resolve last-wins instead of erroring. |
| 197 | func TestBlastRadiusMultipleFormatFlagsLastWins(t *testing.T) { |
| 198 | requireBlastRadiusTools(t) |
| 199 | root := makeBlastRadiusGitRepo(t) |
| 200 | |
| 201 | out, stderr, err := runCodemapWithInput("", "blast-radius", "--markdown", "--json", "--ref", "HEAD", root) |
| 202 | if err != nil { |
| 203 | t.Fatalf("--markdown --json failed: %v\nstderr=%s", err, stderr) |
| 204 | } |
| 205 | var bundle blastRadiusBundle |
| 206 | if err := json.Unmarshal([]byte(out), &bundle); err != nil { |
| 207 | t.Fatalf("expected JSON to win as the last flag, got: %v\n%s", err, out) |
| 208 | } |
| 209 | |
| 210 | md, stderr, err := runCodemapWithInput("", "blast-radius", "--json", "--markdown", "--ref", "HEAD", root) |
| 211 | if err != nil { |
| 212 | t.Fatalf("--json --markdown failed: %v\nstderr=%s", err, stderr) |
| 213 | } |
| 214 | if !strings.Contains(md, "# Codemap Blast Radius") { |
| 215 | t.Fatalf("expected markdown to win as the last flag, got:\n%s", md) |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | // Finding #7: an invalid --ref surfaces the actionable branch/ref hint. |
| 220 | func TestBlastRadiusInvalidRefHint(t *testing.T) { |
nothing calls this directly
no test coverage detected