Check default YAML output semantically
This commit is contained in:
@@ -187,8 +187,9 @@ func TestRequirementsCommandCapturesContextAndVariableAssignments(t *testing.T)
|
||||
if len(received.Inspection.Vars) != 0 || received.Inspection.PromptVersion != "" || received.Inspection.ProfileID != "" || received.Inspection.SessionID != "" {
|
||||
t.Fatalf("second invocation retained native values: %#v", received.Inspection)
|
||||
}
|
||||
if !strings.HasPrefix(output.String(), "prompt_id:") {
|
||||
t.Fatalf("omitted format did not default to YAML: %q", output.String())
|
||||
var defaultReport map[string]any
|
||||
if err := yaml.Unmarshal(output.Bytes(), &defaultReport); err != nil || defaultReport["prompt_id"] != "briefing" {
|
||||
t.Fatalf("omitted format did not produce the selected prompt's YAML report: %#v (decode error %v), output=%q", defaultReport, err, output.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user