bpfmt: Test comment line while sorting arrays

Test: bpfmt test
Change-Id: I4a11ac200a7b10d3abb76db78f4be2ef772763cf
This commit is contained in:
William Escande 2023-05-16 18:46:33 -07:00
parent 65aa5a505f
commit a74d05b939

View file

@ -447,6 +447,116 @@ stuff {
}, },
], ],
} }
`,
},
{
input: `
// test
foo {
stuff: [
"a", // great comment
"b",
],
}
`,
output: `
// test
foo {
stuff: [
"a", // great comment
"b",
],
}
`,
},
{
input: `
// test
foo {
stuff: [
"a",
// b comment
"b",
],
}
`,
output: `
// test
foo {
stuff: [
"a",
// b comment
"b",
],
}
`,
},
{
input: `
// test
foo {
stuff: [
"a", // a comment
// b comment
"b",
],
}
`,
output: `
// test
foo {
stuff: [
"a", // a comment
// b comment
"b",
],
}
`,
},
{
input: `
// test
foo {
stuff: [
"a",
// b comment
// on multiline
"b",
],
}
`,
output: `
// test
foo {
stuff: [
"a",
// b comment
// on multiline
"b",
],
}
`,
},
{ // Line comment are treat as groups separator
input: `
// test
foo {
stuff: [
"b",
// a comment
"a",
],
}
`,
output: `
// test
foo {
stuff: [
"b",
// a comment
"a",
],
}
`, `,
}, },
} }