@@ -769,7 +769,7 @@ map('k', 123, 456)
769769TEST (FormatByStyleOption, space_before_inline_comment) {
770770 LuaStyle style;
771771
772- style.space_before_inline_comment = 1 ;
772+ style.space_before_inline_comment = SpaceBeforeInlineComment ( 1 ) ;
773773 EXPECT_TRUE (TestHelper::TestFormatted (
774774 R"(
775775local t = 123 --hello
@@ -778,7 +778,7 @@ local t = 123 --hello
778778local t = 123 --hello
779779)" ,
780780 style));
781- style.space_before_inline_comment = 2 ;
781+ style.space_before_inline_comment = SpaceBeforeInlineComment ( 2 ) ;
782782 EXPECT_TRUE (TestHelper::TestFormatted (
783783 R"(
784784local t = 123 --hello
@@ -787,6 +787,24 @@ local t = 123 --hello
787787local t = 123 --hello
788788)" ,
789789 style));
790+ style.space_before_inline_comment = SpaceBeforeInlineComment (0 , SpaceBeforeInlineCommentStyle::Keep);
791+ EXPECT_TRUE (TestHelper::TestFormatted (
792+ R"(
793+ local function fff() --123131
794+ local t = "hello world", 1 --12313131
795+ end
796+ local t = hello --fjoiwjfowifw
797+ yes.it.is.me.a = 123 --fjoiwjfowifw
798+ )" ,
799+ R"(
800+ local function fff() --123131
801+ local t = "hello world", 1 --12313131
802+ end
803+ local t = hello --fjoiwjfowifw
804+ yes.it.is.me.a = 123 --fjoiwjfowifw
805+ )" ,
806+ style));
807+
790808}
791809
792810TEST (FormatByStyleOption, space_around_math_operator) {
0 commit comments