Skip to content

Commit

Permalink
Fixed tests to work on Linux (really)
Browse files Browse the repository at this point in the history
  • Loading branch information
yugabe committed Jul 12, 2024
1 parent 42796c0 commit 29bd0ad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/EmbeddedTexts.Tests/EmbeddedTextGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace PodNet.EmbeddedTexts.Tests;
[TestClass]
public class EmbeddedTextGeneratorTests
{
private const string ProjectRoot = @"\home\Users\source\Project"; // Don't use Windows drive letter as root, it'll break Linux tests.
private const string ProjectRoot = @"//home//Users//source//Project"; // Don't use Windows drive letter as root, it'll break Linux tests.

[TestMethod]
public void DoesntGenerateWhenDisabled()
Expand Down Expand Up @@ -107,15 +107,15 @@ public static GeneratorDriverRunResult RunGeneration(bool globalEnabled, bool on

private static Dictionary<Fakes.AdditionalText, Fakes.AnalyzerConfigOptions> GetOptionsForTexts(bool oneItemEnabled) => new()
{
[new($@"{ProjectRoot}\Default.txt", "Test File 1 Content")]
[new($@"{ProjectRoot}//Default.txt", "Test File 1 Content")]
= [],
[new($@"{ProjectRoot}\Parameterized Enabled.cs", "Test File 2 Content")]
[new($@"{ProjectRoot}//Parameterized Enabled.cs", "Test File 2 Content")]
= new() { [$"build_metadata.additionalfiles.{EmbeddedTextsGenerator.EmbedTextMetadataProperty}"] = oneItemEnabled.ToString() },
[new($@"{ProjectRoot}\CustomNamespace.n", "Test File 3 Content")]
[new($@"{ProjectRoot}//CustomNamespace.n", "Test File 3 Content")]
= new() { [$"build_metadata.additionalfiles.{EmbeddedTextsGenerator.EmbedTextNamespaceMetadataProperty}"] = "TestNamespace" },
[new($@"{ProjectRoot}\CustomClassName.n", "Test File 4 Content")]
[new($@"{ProjectRoot}//CustomClassName.n", "Test File 4 Content")]
= new() { [$"build_metadata.additionalfiles.{EmbeddedTextsGenerator.EmbedTextClassNameMetadataProperty}"] = "TestClassName" },
[new($@"{ProjectRoot}\Empty", "")] = [],
[new($@"{ProjectRoot}\Subdirectory\2 Another & Subdirectory/Empty.ini", "")] = [],
[new($@"{ProjectRoot}//Empty", "")] = [],
[new($@"{ProjectRoot}//Subdirectory//2 Another & Subdirectory/Empty.ini", "")] = [],
};
}

0 comments on commit 29bd0ad

Please sign in to comment.