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)
32
32
/// <summary>
33
33
/// Get an absolute document path for use in tests.
34
34
/// </summary>
35
- string AbsoluteDocumentPath => Path . DirectorySeparatorChar + " Foo.txt"; // Absolute path, cross-platform compatible.
35
+ string AbsoluteDocumentPath => IsWindows ? @"C:\ Foo.txt" : "/Foo.txt" ;
36
36
37
37
/// <summary>
38
38
/// The <see cref="LanguageClient"/> under test.
@@ -141,4 +141,4 @@ void HandleServerInitialize()
141
141
} ) ;
142
142
}
143
143
}
144
- }
144
+ }
Original file line number Diff line number Diff line change 2
2
using System ;
3
3
using System . Reactive . Disposables ;
4
4
using System . Reflection ;
5
+ using System . Runtime . InteropServices ;
5
6
using System . Threading ;
6
7
using Xunit ;
7
8
using Xunit . Abstractions ;
@@ -124,5 +125,15 @@ protected virtual void Dispose(bool disposing)
124
125
/// The logging level for the current test.
125
126
/// </summary>
126
127
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 ) ;
127
138
}
128
139
}
You can’t perform that action at this time.
0 commit comments