A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nunit/nunit-console/issues/1469 below:

nunit console can't parse test case with special characters · Issue #1469 · nunit/nunit-console · GitHub

I'm using nunit console 3.18.1, and here's a very interesting case concerning a .net 8.0 windows test project. Here's the project configuration

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
	<UseWPF>True</UseWPF>
	<OutputType>Library</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NUnit" Version="3.14.0" />
	<PackageReference Include="Microsoft.Net.Test.Sdk" Version="17.10.0" />
	<PackageReference Include="NUnit.ConsoleRunner" Version="3.18.1" />
	    <PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
	<PackageReference Include="NUnit.Extension.VSProjectLoader" Version="3.9.0" />
  </ItemGroup>

</Project>

And inside the project it contains one single test class, with one single test case:


  public class SpecialCharTestClass
   
  {
      public static IEnumerable<char> CharTestCases()
      {
          for (char c = char.MinValue; c < 0xDEEE; c += (char)0x0FED)
              yield return c;
          yield return char.MaxValue;
      }
      [TestCaseSource(nameof(CharTestCases))]
      public void CharTest(char c)
      {


      }


  }

I can run it in NUnit3TestAdapter without problem. But if I run it from nunit console, then I will get this XML Exception


NUnit Console 3.18.1+5e16ca2ef85f57f9f09bb41ff08feb8f3168a384 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
Tuesday, September 3, 2024 2:11:23 PM

Runtime Environment
   OS Version: Microsoft Windows NT 6.2.9200.0
   Runtime: .NET Framework CLR v4.0.30319.42000

Test Files
    XXX.sln

System.Xml.XmlException : '?', hexadecimal value 0xFFFF, is an invalid character. Line 1, position 1856.

--XmlException
'?', hexadecimal value 0xFFFF, is an invalid character. Line 1, position 1856.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)
   at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos)
   at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type)
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)
   at NUnit.ConsoleRunner.TestEventHandler.OnTestEvent(String report)
   at NUnit.Engine.Runners.TestEventDispatcher.OnTestEvent(String report)
   at NUnit.Engine.Runners.MasterTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
   at NUnit.Engine.Runners.MasterTestRunner.Run(ITestEventListener listener, TestFilter filter)
   at NUnit.ConsoleRunner.ConsoleRunner.RunTests(TestPackage package, TestFilter filter)
   at NUnit.ConsoleRunner.Program.Main(String[] args)


I don't think it appears if I compile the test project as .net framework 4.8


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