Skip to content

Commit 0b780cc

Browse files
path fix for unix
1 parent bd9b804 commit 0b780cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/PowerShellEditorServices.Test/Language/LanguageServiceTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
using System.Linq;
1616
using System.Threading.Tasks;
1717
using Xunit;
18-
using Microsoft.PowerShell.EditorServices.Test.Shared;
1918
using Microsoft.PowerShell.EditorServices.Services;
2019
using Microsoft.Extensions.Logging.Abstractions;
2120
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
2221
using Microsoft.PowerShell.EditorServices.Services.Symbols;
2322
using System.Collections.Generic;
2423
using Microsoft.PowerShell.EditorServices.Handlers;
24+
using System.Runtime.InteropServices;
2525

2626
namespace Microsoft.PowerShell.EditorServices.Test.Language
2727
{
@@ -33,7 +33,11 @@ public class LanguageServiceTests : IDisposable
3333
private readonly PowerShellContextService powerShellContext;
3434
private static readonly string s_baseSharedScriptPath =
3535
Path.Combine(
36-
Path.GetDirectoryName(typeof(LanguageServiceTests).Assembly.CodeBase),
36+
Path.GetDirectoryName(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
37+
// On non-Windows platforms, CodeBase has file:// in it.
38+
// On Windows, Location points to a temp directory.
39+
? typeof(LanguageServiceTests).Assembly.CodeBase
40+
: typeof(LanguageServiceTests).Assembly.Location),
3741
"..","..","..","..",
3842
"PowerShellEditorServices.Test.Shared");
3943

0 commit comments

Comments
 (0)