Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

calling it a night, wrap up session with a failingtest so I know wher…

…e to resume.
  • Loading branch information...
commit 3df1a20afe90ba08300783f6d92b0e9081d2f101 1 parent 93305b4
Lucas Meijer authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 Tests/RecursiveIncludeScannerTest.cs
View
16 Tests/RecursiveIncludeScannerTest.cs
@@ -35,11 +35,25 @@ public void FailToFindNonExistingHeader()
Assert.Throws<MissingHeaderException>(()=>ris.GetFilesIncludedBy("test.c"));
}
+ [Test]
+ public void CanFindHeaderWithSubDirectorySpecification()
+ {
+ var ris = new RecursiveIncludeScanner(new string[0], file => false, f=>ScanFileMock(f,"sub1/myheader.h"));
+ Directory.CreateDirectory("sub1");
+ File.WriteAllText("sub1/myheader.h", "//boss");
+ var result = ris.GetFilesIncludedBy("test.c");
+ Assert.AreEqual("sub1/myheader.h", result.Single());
+ }
+
private static IEnumerable<string> ScanFileMock(string file)
{
+ return ScanFileMock(file, "myheader.h");
+ }
+ private static IEnumerable<string> ScanFileMock(string file,string headertofind)
+ {
if (file != "test.c")
yield break;
- yield return "myheader.h";
+ yield return headertofind;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.