Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions test/js/bun/shell/brace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,7 @@ describe("$.braces", () => {
["{x,{a,,b}}", ["x", "a", "", "b"]],
["{x,{a,b,}}", ["x", "a", "b", ""]],
["{{a,},x}", ["a", "", "x"]],
["{{a,}{b,}}", ["ab", "a", "b", ""]],
["p{q,{r,}{s,}}t", ["pqt", "prst", "prt", "pst", "pt"]],
// A nested comma-free `{}` previously parsed to 0 variants, which made
// expand_nested return early and drop the text after it. It is now 1
// empty variant, matching calculate_expanded_amount and expand_flat.
["{x,a{}b}", ["x", "ab"]],
["{a,b{}}c", ["ac", "bc"]],
["{x,{}y}", ["x", "y"]],
])("%s", (pattern, expected) => {
expect($.braces(pattern)).toEqual(expected);
});
Expand Down Expand Up @@ -222,6 +215,7 @@ describe("comma-less brace group is literal (bash 5.2)", () => {
// `{foo}` with no comma is literal at any depth.
["{a,{b}}", ["a", "{b}"]],
["{a{b,c}}", ["{ab}", "{ac}"]],
["{{a,}{b,}}", ["{ab}", "{a}", "{b}", "{}"]],
// A comma outside every `{...}` does not make one expand.
["{foo},x", ["{foo},x"]],
["{a},{b}", ["{a},{b}"]],
Expand Down
Loading