From 8e92561867c822a1d0eee7e93a60423c7d265ab5 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 25 May 2023 19:18:47 +1000 Subject: [PATCH 1/3] . --- .../ExceptionParsingTests.cs | 2 +- src/Verify.ExceptionParsing/Parser.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs index 6b242420e3..ad101a230f 100644 --- a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs +++ b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.cs @@ -120,7 +120,7 @@ public Task MsTest() { var exceptionMessage = $""" Test method TheTests.XAMLCombinerTests.TestOutput threw exception: - VerifyException : Directory: {Environment.CurrentDirectory} + VerifyException: Directory: {Environment.CurrentDirectory} NotEqual: - Received: XAMLCombinerTests.TestOutput.received.xaml Verified: XAMLCombinerTests.TestOutput.verified.xaml diff --git a/src/Verify.ExceptionParsing/Parser.cs b/src/Verify.ExceptionParsing/Parser.cs index af7319c029..1e7eb2a1e8 100644 --- a/src/Verify.ExceptionParsing/Parser.cs +++ b/src/Verify.ExceptionParsing/Parser.cs @@ -119,6 +119,16 @@ void ThrowIfEmpty(string directory) return directory; } + // MsTest + if (firstLine.StartsWith("VerifyException: Directory: ")) + { + var directory = firstLine[30..]; + + ThrowIfEmpty(directory); + + return directory; + } + if (firstLine.StartsWith("Directory: ")) { var directory = firstLine[11..]; From ff819caa6cf10d5d013b218e45de1a4dc3fc6c3d Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 25 May 2023 19:28:23 +1000 Subject: [PATCH 2/3] Update Parser.cs --- src/Verify.ExceptionParsing/Parser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Verify.ExceptionParsing/Parser.cs b/src/Verify.ExceptionParsing/Parser.cs index 1e7eb2a1e8..0b8e777c7d 100644 --- a/src/Verify.ExceptionParsing/Parser.cs +++ b/src/Verify.ExceptionParsing/Parser.cs @@ -122,7 +122,7 @@ void ThrowIfEmpty(string directory) // MsTest if (firstLine.StartsWith("VerifyException: Directory: ")) { - var directory = firstLine[30..]; + var directory = firstLine[28..]; ThrowIfEmpty(directory); @@ -138,7 +138,7 @@ void ThrowIfEmpty(string directory) return directory; } - throw new ParseException("Expected content to contain `Directory:` or `VerifyException : Directory:` at the start."); + throw new ParseException("Expected content to contain `Directory:`, or `VerifyException : Directory:`, or `VerifyException: Directory:` at the start."); } static string TrimStart(string next, string prefix) From 8ee2eef17faf66a92948399f447c5d7dfaa15907 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 25 May 2023 19:29:25 +1000 Subject: [PATCH 3/3] Update ExceptionParsingTests.Error_EmptyList.verified.txt --- .../ExceptionParsingTests.Error_EmptyList.verified.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt index d9804b4ddd..30ac935311 100644 --- a/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt +++ b/src/Verify.ExceptionParsing.Tests/ExceptionParsingTests.Error_EmptyList.verified.txt @@ -1,4 +1,4 @@ { Type: ParseException, - Message: Expected content to contain `Directory:` or `VerifyException : Directory:` at the start. Ensure the current stable of Verify is being used. + Message: Expected content to contain `Directory:`, or `VerifyException : Directory:`, or `VerifyException: Directory:` at the start. Ensure the current stable of Verify is being used. } \ No newline at end of file