Skip to content

Commit b8535e0

Browse files
committed
Added test for implicit Sub in a different Class Module
1 parent 7866984 commit b8535e0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

RubberduckTests/Inspections/AssignedByValParameterMakeLocalCopyQuickFixTests.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Private Sub FooFight(ByRef arg1 As String)
290290
Let arg1 = ""test""
291291
End Sub
292292
";
293-
var secondClassBody =
293+
var secondClassBody =
294294
@"
295295
Private memberString As String
296296
Private memberLong As Long
@@ -321,6 +321,14 @@ Private Sub FooFighters(ByRef arg1 As String)
321321
xArg1 = 6
322322
Let arg1 = ""test""
323323
End Sub
324+
325+
Sub Bar()
326+
Dim st As String
327+
st = ""Test""
328+
Dim v As Long
329+
v = 5
330+
result = KungFooFighting(st, v)
331+
End Sub
324332
";
325333

326334
var firstModuleBody =
@@ -362,7 +370,7 @@ End Sub
362370

363371
//This list of names results are invalid to use - and results in no change to the code module
364372
string[] inValidNames = { "CantTouchThis", "BigNumber", "DoSomething"
365-
, "myEggo", "SetFilename", firstClass.Key, secondClass.Key
373+
, "myEggo", "SetFilename","Foo", firstClass.Key, secondClass.Key
366374
, firstModule.Key, secondModule.Key};
367375
foreach (var invalidName in inValidNames)
368376
{
@@ -371,7 +379,7 @@ End Sub
371379
}
372380

373381
//This list of names results in modifying the code module
374-
string[] validNames = { "myNewVariable", "Foo2" };
382+
string[] validNames = { "myNewVariable", "Foo2", "Bar" };
375383
foreach (var validName in validNames)
376384
{
377385
var quickFixResult = GetQuickFixResult(validName, firstClass, standardModules, classModules);

0 commit comments

Comments
 (0)