File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public ClientTests(ITestOutputHelper testOutput)
3232 /// <summary>
3333 /// Get an absolute document path for use in tests.
3434 /// </summary>
35- string AbsoluteDocumentPath => Path . DirectorySeparatorChar + " Foo.txt"; // Absolute path, cross-platform compatible.
35+ string AbsoluteDocumentPath => IsWindows ? @"C:\ Foo.txt" : "/Foo.txt" ;
3636
3737 /// <summary>
3838 /// The <see cref="LanguageClient"/> under test.
@@ -141,4 +141,4 @@ void HandleServerInitialize()
141141 } ) ;
142142 }
143143 }
144- }
144+ }
Original file line number Diff line number Diff line change 22using System ;
33using System . Reactive . Disposables ;
44using System . Reflection ;
5+ using System . Runtime . InteropServices ;
56using System . Threading ;
67using Xunit ;
78using Xunit . Abstractions ;
@@ -124,5 +125,15 @@ protected virtual void Dispose(bool disposing)
124125 /// The logging level for the current test.
125126 /// </summary>
126127 protected virtual LogLevel LogLevel => LogLevel . Information ;
128+
129+ /// <summary>
130+ /// Is the test running on Windows?
131+ /// </summary>
132+ protected virtual bool IsWindows => RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ;
133+
134+ /// <summary>
135+ /// Is the test running on a Unix-like operating system?
136+ /// </summary>
137+ protected virtual bool IsUnix => RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) || RuntimeInformation . IsOSPlatform ( OSPlatform . OSX ) ;
127138 }
128139}
You can’t perform that action at this time.
0 commit comments