Skip to content

Test Cases With Strings That Contain the Pipe Character are Not Run #1405

@JasonBock

Description

@JasonBock

To Reproduce

  • Create a new project that targets .NET 10. Specifically, ensure the project file has this setup:
<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<EnableNUnitRunner>true</EnableNUnitRunner>
		<LangVersion>latest</LangVersion>
		<TargetFramework>net10.0</TargetFramework>
		<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
		<PackageReference Include="NUnit" Version="4.4.0" />
		<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
			<PrivateAssets>all</PrivateAssets>
			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
		</PackageReference>
		<PackageReference Include="NUnit3TestAdapter" Version="6.1.0" />
	</ItemGroup>
</Project>
  • Add a test to the project:
using NUnit.Framework;

namespace NUnitIssue;

public static class TestIssue
{
    [TestCase("This | That", false)]
    public static void TestLength(string input, bool expected) =>
        Assert.That(input.Length % 2 == 0, Is.EqualTo(expected));
}

Expected

The test runs and passes.

Actual

The test doesn't run at all.

Commentary

If I remove the | character, it runs. This is similar to another issue I reported, which is fixed, but a pipe character still seems to cause the runner to ignore it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions