jcansdale / TestDriven.Net-Issues

Issue tracking for TestDriven.Net
https://github.com/jcansdale/TestDriven.Net-Issues/issues
24 stars 2 forks source link

XUnit Unicode output munged in Output window #41

Closed tillig closed 8 years ago

tillig commented 8 years ago

Using dotnet-test-xunit/2.2.0-preview2-build1029 with the latest beta of TD.NET (which allows the .xproj and assembly names to be correctly detected even if they differ):

A unit test checking string equality against a really long string:

Assert.Equal("no-match", "this is a really long value that will get truncated");

When this fails, the VS Test Explorer outputs:

Assert.Equal() Failure
          ↓ (pos 0)
Expected: no-match
Actual:   this is a really long value that will get···
          ↑ (pos 0)

Note the "arrows" and the get··· Unicode thing. TestDriven.NET output window contents are similar, though the Unicode gets munged:

Test 'ConsoleOutputRepro.ReproTest.WeirdOutputRepro' failed: Assert.Equal() Failure
          ↓ (pos 0)
Expected: role
Actual:   this is a really long value that will get···
          ↑ (pos 0)

I've tried a couple of different fonts to see if it was something I could change in the output window but it appears the data coming in is actually not Unicode so there's nothing I can do.

jcansdale commented 8 years ago

I tried creating a .NET Core console app as follows:

    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("↓ (pos 0)");
        }
    }

I seem to be getting something very similar using dotet run:

Project ConsoleApp6 (.NETCoreApp,Version=v1.0) will be compiled because Input items removed from last build
Compiling ConsoleApp6 for .NETCoreApp,Version=v1.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:01.6433971

Ôåô (pos 0)

Do you think this is a .NET Core unicode support thing? I'd be interested to find a workaround/fix.

tillig commented 8 years ago

Oh, good one. It didn't occur to me that it'd be this low level. The fact it showed up right in the VS Test Explorer fooled me into thinking it was limited to the test integration. Looks like there have been several Unicode-related issues for dotnet CLI so maybe it's a tooling thing.

jcansdale commented 8 years ago

@bradwilson I'm guessing you'll have seen this issue before. Do you know of any workarounds?

jcansdale commented 8 years ago

I wonder is this might have been fixed along with ANSI colors when doing a dotnet test.

See here: http://www.hanselman.com/blog/WheresDNVMSafelyRunningMultipleVersionsOfTheNETCoreSDKAndToolingWithGlobaljson.aspx

If you have a chance to try it, please let me know. I don't want to derail my working on the TestDriven.Net 4.0-beta release. :wink:

tillig commented 8 years ago

It appears to work correctly under dotnet CLI 1.0.0-preview3-003223. 1.0.0-preview3-003223

This is not the first "ARGH! TOOLING!" that I've run into. :weary: Thanks for the patience.