public void CacheWhenCPPChanges() { // Make sure that when the C++ code changes, the cache key for lookup of results will also change. var q = new QueriableDummy <ntup>(); var mym = new MyModifiableCode(); mym.LOC = new string[] { "int i = 0;", "MultBy2 = 10;" }; var i = q.Select(e => mym.MultBy2(e.run)).Where(x => x > 2).Count(); var query = DummyQueryExectuor.LastQueryModel; // Set the LOC to something. var str1 = FormattingQueryVisitor.Format(query); mym.LOC = new string[] { "int j = 10;", "MultBy2 = 10;" }; var str2 = FormattingQueryVisitor.Format(query); Console.WriteLine(str1); Console.WriteLine(str2); Assert.AreNotEqual(str1, str2); }
public void CacheWhenIncludesChange() { // Make sure that when the C++ code changes, the cache key for lookup of results will also change. var q = new QueriableDummy<ntup>(); var mym = new MyModifiableCode(); mym.LOC = new string[] { "int i = 0;", "MultBy2 = 10;" }; var i = q.Select(e => mym.MultBy2(e.run)).Where(x => x > 2).Count(); var query = DummyQueryExectuor.LastQueryModel; // Set the LOC to something. mym.Includes = new string[] { "TMVAReader.h" }; var str1 = FormattingQueryVisitor.Format(query); mym.Includes = new string[] { "TFile.h" }; var str2 = FormattingQueryVisitor.Format(query); Console.WriteLine(str1); Console.WriteLine(str2); Assert.AreNotEqual(str1, str2); }