Skip to content

Commit 3c0cdaf

Browse files
aledbfclaude
andcommitted
test(cli): pin additional feature option order without prior order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b547686 commit 3c0cdaf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎internal/cli/helpers_held_test.go‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@ func TestMergeAdditionalFeaturesRejectsInvalidJSON(t *testing.T) {
6565
t.Errorf("features = %v, want the config untouched on a parse error", cfg.Features)
6666
}
6767
}
68+
69+
// A config with no recorded option order still gets one for an additional
70+
// Feature, even one with a single option.
71+
func TestMergeAdditionalFeaturesRecordsASingleOptionWithoutPriorOrder(t *testing.T) {
72+
cfg := &config.DevContainer{}
73+
if _, err := mergeAdditionalFeatures(cfg, `{"./g": {"only": 1}}`); err != nil {
74+
t.Fatal(err)
75+
}
76+
if got := cfg.FeatureOptionOrder["./g"]; !slices.Equal(got, []string{"only"}) {
77+
t.Errorf("FeatureOptionOrder[./g] = %v, want [only]", got)
78+
}
79+
}

0 commit comments

Comments
 (0)