MCPcopy Create free account
hub / github.com/dkorunic/betteralign / TestStringArrayFlagSetAccumulates

Function TestStringArrayFlagSetAccumulates

betteralign_unit_test.go:1168–1188  ·  view source on GitHub ↗

TestStringArrayFlagSetAccumulates verifies that successive Set calls append. Both forms (repeated flag use and comma-separated values) must accumulate without inserting empty entries.

(t *testing.T)

Source from the content-addressed store, hash-verified

1166// Both forms (repeated flag use and comma-separated values) must accumulate
1167// without inserting empty entries.
1168func TestStringArrayFlagSetAccumulates(t *testing.T) {
1169 var f StringArrayFlag
1170 if err := f.Set("a,b"); err != nil {
1171 t.Fatalf("first Set returned error: %v", err)
1172 }
1173 if err := f.Set("c"); err != nil {
1174 t.Fatalf("second Set returned error: %v", err)
1175 }
1176 if err := f.Set(""); err != nil {
1177 t.Fatalf("third Set returned error: %v", err)
1178 }
1179 want := []string{"a", "b", "c"}
1180 if len(f) != len(want) {
1181 t.Fatalf("got %v, want %v", []string(f), want)
1182 }
1183 for i := range f {
1184 if f[i] != want[i] {
1185 t.Errorf("[%d] = %q, want %q", i, f[i], want[i])
1186 }
1187 }
1188}
1189
1190// ─── Layer 13: gcSizes.Alignof additional branches ───────────────────────────
1191

Callers

nothing calls this directly

Calls 1

SetMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…