From fe0897e2b1d57d4a9a7aafe234e3570419c1c7c6 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 16:13:45 +0500 Subject: [PATCH 1/7] Update to use xunit.v3 --- TruePath.Tests/LocalPathTests.cs | 2 -- TruePath.Tests/NormalizationTests.cs | 1 - TruePath.Tests/TruePath.Tests.csproj | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/TruePath.Tests/LocalPathTests.cs b/TruePath.Tests/LocalPathTests.cs index 716f01a..d4193b3 100644 --- a/TruePath.Tests/LocalPathTests.cs +++ b/TruePath.Tests/LocalPathTests.cs @@ -2,8 +2,6 @@ // // SPDX-License-Identifier: MIT -using Xunit.Abstractions; - namespace TruePath.Tests; public class LocalPathTests(ITestOutputHelper output) diff --git a/TruePath.Tests/NormalizationTests.cs b/TruePath.Tests/NormalizationTests.cs index 8b6a2d2..5919c44 100644 --- a/TruePath.Tests/NormalizationTests.cs +++ b/TruePath.Tests/NormalizationTests.cs @@ -6,7 +6,6 @@ using FsCheck.Fluent; using FsCheck.Xunit; using JetBrains.Annotations; -using Xunit.Abstractions; namespace TruePath.Tests; diff --git a/TruePath.Tests/TruePath.Tests.csproj b/TruePath.Tests/TruePath.Tests.csproj index a550166..4a58a7c 100644 --- a/TruePath.Tests/TruePath.Tests.csproj +++ b/TruePath.Tests/TruePath.Tests.csproj @@ -14,14 +14,14 @@ SPDX-License-Identifier: MIT - + - runtime; build; native; contentfiles; analyzers; buildtransitive all + From fc2a6ac067251ad54d8cb26d3f03d9b9b26904d9 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 18:29:42 +0500 Subject: [PATCH 2/7] Update licensing --- TruePath.Tests/LocalPathTests.cs | 2 +- TruePath.Tests/NormalizationTests.cs | 2 +- TruePath.Tests/TruePath.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TruePath.Tests/LocalPathTests.cs b/TruePath.Tests/LocalPathTests.cs index d4193b3..baeeb3d 100644 --- a/TruePath.Tests/LocalPathTests.cs +++ b/TruePath.Tests/LocalPathTests.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 Friedrich von Never +// SPDX-FileCopyrightText: 2024-2026 TruePath contributors // // SPDX-License-Identifier: MIT diff --git a/TruePath.Tests/NormalizationTests.cs b/TruePath.Tests/NormalizationTests.cs index 5919c44..227f869 100644 --- a/TruePath.Tests/NormalizationTests.cs +++ b/TruePath.Tests/NormalizationTests.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024-2025 TruePath contributors +// SPDX-FileCopyrightText: 2024-2026 TruePath contributors // // SPDX-License-Identifier: MIT diff --git a/TruePath.Tests/TruePath.Tests.csproj b/TruePath.Tests/TruePath.Tests.csproj index 4a58a7c..fca8ab8 100644 --- a/TruePath.Tests/TruePath.Tests.csproj +++ b/TruePath.Tests/TruePath.Tests.csproj @@ -1,5 +1,5 @@ From 0d6ead7366f1b03a71eab5d59b3626dafed3754a Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 22:12:16 +0500 Subject: [PATCH 3/7] Mention elevated privileges on Windows for symlinks creation in CONTRIBUTING.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 978e0f0..d475752 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,7 @@ Use the following shell command: ```console $ dotnet test ``` +Tests involving symlink creation require elevated privileges on Windows, as this is enforced at the OS level. Test Documentation ------------------ From 3b3d2f2d350c67ae736de3638b0dcab8ff662ea9 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 22:28:22 +0500 Subject: [PATCH 4/7] Update test ReadKind_IsSymlink --- TruePath.Tests/AbsolutePathTests.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/TruePath.Tests/AbsolutePathTests.cs b/TruePath.Tests/AbsolutePathTests.cs index e9fa601..c8dba16 100644 --- a/TruePath.Tests/AbsolutePathTests.cs +++ b/TruePath.Tests/AbsolutePathTests.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 Friedrich von Never +// SPDX-FileCopyrightText: 2024-2026 Friedrich von Never // // SPDX-License-Identifier: MIT @@ -91,7 +91,18 @@ public void ReadKind_IsSymlink() var tempDirectoryInfo = Path.GetTempPath(); - Directory.CreateSymbolicLink(currentDirectory, tempDirectoryInfo); + try + { + Directory.CreateSymbolicLink(currentDirectory, tempDirectoryInfo); + } + catch (IOException e) when (OperatingSystem.IsWindows()) // && !TestFramework.RunsOnCi()) + { // TODO: Implement `TestFramework.RunsOnCi` + if (e.Message.Contains("privilege") && (e.StackTrace?.Contains("CreateSymbolicLink") ?? false)) + { + Assert.Skip("Tests involving symlink creation require elevated privileges on Windows, as this is enforced at the OS level."); + } + else throw; + } // Act var kind = localPath.ReadKind(); From 5b0682251d6d021b250bcec431baf8358ed6be41 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 23:29:26 +0500 Subject: [PATCH 5/7] Add Utils.RunsOnCi --- TruePath.Tests/AbsolutePathTests.cs | 6 +++--- TruePath.Tests/Utils.cs | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/TruePath.Tests/AbsolutePathTests.cs b/TruePath.Tests/AbsolutePathTests.cs index c8dba16..c7f784e 100644 --- a/TruePath.Tests/AbsolutePathTests.cs +++ b/TruePath.Tests/AbsolutePathTests.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024-2026 Friedrich von Never +// SPDX-FileCopyrightText: 2024-2026 TruePath contributors // // SPDX-License-Identifier: MIT @@ -95,8 +95,8 @@ public void ReadKind_IsSymlink() { Directory.CreateSymbolicLink(currentDirectory, tempDirectoryInfo); } - catch (IOException e) when (OperatingSystem.IsWindows()) // && !TestFramework.RunsOnCi()) - { // TODO: Implement `TestFramework.RunsOnCi` + catch (IOException e) when (OperatingSystem.IsWindows() && !Utils.RunsOnCi()) + { if (e.Message.Contains("privilege") && (e.StackTrace?.Contains("CreateSymbolicLink") ?? false)) { Assert.Skip("Tests involving symlink creation require elevated privileges on Windows, as this is enforced at the OS level."); diff --git a/TruePath.Tests/Utils.cs b/TruePath.Tests/Utils.cs index 86b49de..ccc8111 100644 --- a/TruePath.Tests/Utils.cs +++ b/TruePath.Tests/Utils.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 TruePath contributors +// SPDX-FileCopyrightText: 2024-2026 TruePath contributors // // SPDX-License-Identifier: MIT @@ -22,4 +22,9 @@ internal static string ToNonCanonicalCase(this string path) return nonCanonicalPath; } + + internal static bool RunsOnCi() + { + return Environment.GetEnvironmentVariable("CI") is not null; + } } From f7efdfbd6fdfa1fc29f421655823f459b355c9e7 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Mon, 9 Feb 2026 23:37:19 +0500 Subject: [PATCH 6/7] reset to initial state --- TruePath.Tests/LocalPathTests.cs | 4 +++- TruePath.Tests/NormalizationTests.cs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TruePath.Tests/LocalPathTests.cs b/TruePath.Tests/LocalPathTests.cs index baeeb3d..716f01a 100644 --- a/TruePath.Tests/LocalPathTests.cs +++ b/TruePath.Tests/LocalPathTests.cs @@ -1,7 +1,9 @@ -// SPDX-FileCopyrightText: 2024-2026 TruePath contributors +// SPDX-FileCopyrightText: 2024 Friedrich von Never // // SPDX-License-Identifier: MIT +using Xunit.Abstractions; + namespace TruePath.Tests; public class LocalPathTests(ITestOutputHelper output) diff --git a/TruePath.Tests/NormalizationTests.cs b/TruePath.Tests/NormalizationTests.cs index 227f869..8b6a2d2 100644 --- a/TruePath.Tests/NormalizationTests.cs +++ b/TruePath.Tests/NormalizationTests.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024-2026 TruePath contributors +// SPDX-FileCopyrightText: 2024-2025 TruePath contributors // // SPDX-License-Identifier: MIT @@ -6,6 +6,7 @@ using FsCheck.Fluent; using FsCheck.Xunit; using JetBrains.Annotations; +using Xunit.Abstractions; namespace TruePath.Tests; From bd8f9851a6b27b171b7963523703935c15e68f71 Mon Sep 17 00:00:00 2001 From: pkazakov-dev Date: Tue, 10 Feb 2026 12:04:27 +0500 Subject: [PATCH 7/7] Remove not used ns usings --- TruePath.Tests/LocalPathTests.cs | 4 +--- TruePath.Tests/NormalizationTests.cs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/TruePath.Tests/LocalPathTests.cs b/TruePath.Tests/LocalPathTests.cs index 716f01a..baeeb3d 100644 --- a/TruePath.Tests/LocalPathTests.cs +++ b/TruePath.Tests/LocalPathTests.cs @@ -1,9 +1,7 @@ -// SPDX-FileCopyrightText: 2024 Friedrich von Never +// SPDX-FileCopyrightText: 2024-2026 TruePath contributors // // SPDX-License-Identifier: MIT -using Xunit.Abstractions; - namespace TruePath.Tests; public class LocalPathTests(ITestOutputHelper output) diff --git a/TruePath.Tests/NormalizationTests.cs b/TruePath.Tests/NormalizationTests.cs index 8b6a2d2..227f869 100644 --- a/TruePath.Tests/NormalizationTests.cs +++ b/TruePath.Tests/NormalizationTests.cs @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024-2025 TruePath contributors +// SPDX-FileCopyrightText: 2024-2026 TruePath contributors // // SPDX-License-Identifier: MIT @@ -6,7 +6,6 @@ using FsCheck.Fluent; using FsCheck.Xunit; using JetBrains.Annotations; -using Xunit.Abstractions; namespace TruePath.Tests;