Skip to content

Commit 2991c0a

Browse files
committed
Add test for #2402
1 parent 3b81092 commit 2991c0a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

RubberduckTests/SmartIndenter/LineContinuationTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,5 +741,31 @@ public void TrailingMultiLineCommentSecondNoAlignWorks()
741741
var actual = indenter.Indent(code, string.Empty);
742742
Assert.IsTrue(expected.SequenceEqual(actual));
743743
}
744+
745+
//https://github.com/rubberduck-vba/Rubberduck/issues/2402
746+
[TestMethod] // Broken in VB6 SmartIndenter.
747+
[TestCategory("Indenter")]
748+
public void SplitNamedParameterAlignsCorrectly()
749+
{
750+
var code = new[]
751+
{
752+
"Sub Foo()",
753+
"Debug.Print WorksheetFunction.Sum(arg1:=1, arg2:=2, arg3 _",
754+
":=3)",
755+
"End Sub"
756+
};
757+
758+
var expected = new[]
759+
{
760+
"Sub Foo()",
761+
" Debug.Print WorksheetFunction.Sum(arg1:=1, arg2:=2, arg3 _",
762+
" :=3)",
763+
"End Sub"
764+
};
765+
766+
var indenter = new Indenter(null, () => IndenterSettingsTests.GetMockIndenterSettings());
767+
var actual = indenter.Indent(code, string.Empty);
768+
Assert.IsTrue(expected.SequenceEqual(actual));
769+
}
744770
}
745771
}

0 commit comments

Comments
 (0)