From dd64ae0c2daa5192a8e3667aaae2a8f22400b210 Mon Sep 17 00:00:00 2001 From: Reuven Date: Wed, 28 Feb 2024 19:31:00 +0200 Subject: [PATCH] remove escaping from errors --- internal/run_unix_test.go | 6 ++++-- internal/run_windows_test.go | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/run_unix_test.go b/internal/run_unix_test.go index c369a7f7..4767268e 100644 --- a/internal/run_unix_test.go +++ b/internal/run_unix_test.go @@ -14,11 +14,13 @@ import ( func Test_InvalidFileUnix(t *testing.T) { var stderr bytes.Buffer require.Equal(t, 102, internal.Run(cmdToArgs("oasdiff diff no-file ../data/openapi-test3.yaml"), io.Discard, &stderr)) - require.Equal(t, "Error: failed to load base spec from \"no-file\": open no-file: no such file or directory\n", stderr.String()) + require.Equal(t, `Error: failed to load base spec from "no-file": open no-file: no such file or directory +`, stderr.String()) } func Test_ComposedModeInvalidFileUnix(t *testing.T) { var stderr bytes.Buffer require.Equal(t, 103, internal.Run(cmdToArgs("oasdiff diff ../data/allof/* ../data/allof/* --composed --flatten"), io.Discard, &stderr)) - require.Equal(t, "Error: failed to load base specs from glob \"../data/allof/*\": failed to flatten allOf in \"../data/allof/invalid.yaml\": unable to resolve Type conflict: all Type values must be identical\n", stderr.String()) + require.Equal(t, `Error: failed to load base specs from glob "../data/allof/*": failed to flatten allOf in "../data/allof/invalid.yaml": unable to resolve Type conflict: all Type values must be identical +`, stderr.String()) } diff --git a/internal/run_windows_test.go b/internal/run_windows_test.go index e0d884d7..3b8487cf 100644 --- a/internal/run_windows_test.go +++ b/internal/run_windows_test.go @@ -12,11 +12,13 @@ import ( func Test_InvalidFileWindows(t *testing.T) { var stderr bytes.Buffer require.Equal(t, 102, internal.Run(cmdToArgs("oasdiff diff no-file ../data/openapi-test3.yaml"), io.Discard, &stderr)) - require.Equal(t, "Error: failed to load base spec from \"no-file\": open no-file: The system cannot find the file specified.\n", stderr.String()) + require.Equal(t, `Error: failed to load base spec from "no-file": open no-file: The system cannot find the file specified. +`, stderr.String()) } func Test_ComposedModeInvalidFileWindows(t *testing.T) { var stderr bytes.Buffer require.Equal(t, 103, internal.Run(cmdToArgs("oasdiff diff ../data/allof/* ../data/allof/* --composed --flatten"), io.Discard, &stderr)) - require.Equal(t, "Error: failed to load base specs from glob \"../data/allof/*\": failed to flatten allOf in \"..\\data\\allof\\invalid.yaml\": unable to resolve Type conflict: all Type values must be identical\n", stderr.String()) + require.Equal(t, `Error: failed to load base specs from glob "../data/allof/*": failed to flatten allOf in "..\\data\\allof\\invalid.yaml": unable to resolve Type conflict: all Type values must be identical +`, stderr.String()) }