diff --git a/parser/printer_test.go b/parser/printer_test.go index c889b2a..b708441 100644 --- a/parser/printer_test.go +++ b/parser/printer_test.go @@ -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", + ], +} `, }, }