Skip to content

Commit fccbe4e

Browse files
committed
Add Test for Declare PtrSafe #4795
1 parent 143fc9d commit fccbe4e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

RubberduckTests/SmartIndenter/LineContinuationTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,28 @@ public void DeclarationLineAlignsCorrectly()
2929
Assert.IsTrue(expected.SequenceEqual(actual));
3030
}
3131

32+
// https://github.com/rubberduck-vba/Rubberduck/issues/4795
33+
[Test]
34+
[Category("Indenter")]
35+
public void DeclarationPtrSafeLineAlignsCorrectly()
36+
{
37+
var code = new[]
38+
{
39+
@"Private Declare PtrSafe Function Foo Lib ""bar.dll"" _",
40+
"(x As Long y As Long) As LongPtr"
41+
};
42+
43+
var expected = new[]
44+
{
45+
@"Private Declare PtrSafe Function Foo Lib ""bar.dll"" _",
46+
" (x As Long y As Long) As LongPtr"
47+
};
48+
49+
var indenter = new Indenter(null, () => IndenterSettingsTests.GetMockIndenterSettings());
50+
var actual = indenter.Indent(code);
51+
Assert.IsTrue(expected.SequenceEqual(actual));
52+
}
53+
3254
[Test]
3355
[Category("Indenter")]
3456
public void FunctionParametersAlignCorrectly()

0 commit comments

Comments
 (0)