2 using System
.Runtime
.CompilerServices
;
5 class CallerFilePathTest
7 static void TraceStatic2([CallerMemberName
][CallerFilePath
] object fp
= null)
11 public static void TraceStatic(string expected
, [CallerFilePath
] string filepath
= "--")
13 filepath
= Path
.GetFileName (filepath
);
15 Console
.WriteLine (filepath
);
17 if (expected
!= filepath
)
18 throw new ApplicationException (string.Format ("`{0}' != `{1}'", expected
, filepath
));
21 public static void Main ()
23 TraceStatic ("gtest-optional-24.cs");