Permalink
Browse files

add test to show we can also find headerfiles that are not generated …

…yet.
  • Loading branch information...
Lucas Meijer
Lucas Meijer committed Apr 16, 2012
1 parent 2529e0e commit 0e459e160b1886e2044a3fab5fb86ff0ed466b7a
Showing with 10 additions and 0 deletions.
  1. +10 −0 Tests/RecursiveIncludeScannerTest.cs
@@ -55,6 +55,16 @@ public void CanFindHeaderInIncludePath()
Assert.AreEqual("sub1/myheader.h", result.Single());
}
+ [Test]
+ public void CanFindNotYetCreatedHeaderInIncludePath()
+ {
+ var ris = new RecursiveIncludeScanner(new[] { "sub1" ,"sub2"}, file => file == "sub1/myheader.h", f => ScanFileMock(f, "myheader.h"));
+ Directory.CreateDirectory("sub2");
+ File.WriteAllText("sub2/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");

0 comments on commit 0e459e1

Please sign in to comment.