Hi!
It turned out that ==
operator for test names with quotes or spaces cannot be passed via @FILE
, unlike the case when it is passed as command line arguments:
using NUnit.Framework;
namespace nunit_testfilter_csharp
{
[TestFixture]
public class Class1
{
[TestCase("with spaces")]
public void Test(string name)
{
Assert.AreEqual(name, "with spaces");
}
}
}
and run with:
>TYPE ...\NunitWhereArg.txt
"test==/nunit_testfilter_csharp.Class1.Test(\"with spaces\")/"
>tools\nunit3-console.exe ...\bin\Debug\nunit_testfilter_csharp.dll --where @...\NunitWhereArg.txt --noresult
NUnit Console 3.16.3 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
Tuesday, August 15, 2023 1:09:40 PM
Runtime Environment
OS Version: Microsoft Windows NT 6.2.9200.0
Runtime: .NET Framework CLR v4.0.30319.42000
Test Files
C:\p\test\nunit_testfilter_csharp\bin\Debug\nunit_testfilter_csharp.dll
with
spaces\")/"
System.ArgumentException : Illegal characters in path.
--ArgumentException
Illegal characters in path.
at System.IO.LongPathHelper.Normalize(String path, UInt32 maxPathLength, Boolean checkInvalidCharacters, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at NUnit.Engine.TestPackage..ctor(String filePath)
at NUnit.Engine.TestPackage..ctor(IList`1 testFiles)
at NUnit.ConsoleRunner.ConsoleRunner.MakeTestPackage(ConsoleOptions options)
at NUnit.ConsoleRunner.ConsoleRunner.Execute()
at NUnit.ConsoleRunner.Program.Main(String[] args)
but it works when passing --where
argument as parameters of a command line:
>...\tools\nunit3-console.exe ...\bin\Debug\nunit_testfilter_csharp.dll --where "test==/nunit_testfilter_csharp.Class1.Test(\"with spaces\")/" --noresult
NUnit Console 3.16.3 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
Tuesday, August 15, 2023 1:15:44 PM
Runtime Environment
OS Version: Microsoft Windows NT 6.2.9200.0
Runtime: .NET Framework CLR v4.0.30319.42000
Test Files
C:\p\test\nunit_testfilter_csharp\bin\Debug\nunit_testfilter_csharp.dll
Test Filters
Where: test==/nunit_testfilter_csharp.Class1.Test("with spaces")/
Run Settings
DisposeRunners: True
WorkDirectory: ...
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False
TargetRuntimeFramework: net-4.7.2
NumberOfTestWorkers: 20
Test Run Summary
Overall result: Passed
Test Count: 1, Passed: 1, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2023-08-15 11:15:44Z
End time: 2023-08-15 11:15:44Z
Duration: 0.552 seconds
NUnit Console 3.16.3
NUnit 3.13.3
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4