From dc079c40c62b8ba144fb908d73702ac16c40c465 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 14:16:01 +0000 Subject: [PATCH 1/2] chore: Bump aweXpect and aweXpect.Core Bumps aweXpect from 2.27.1 to 2.31.0 Bumps aweXpect.Core from 2.25.1 to 2.28.0 --- updated-dependencies: - dependency-name: aweXpect dependency-version: 2.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: awexpect - dependency-name: aweXpect.Core dependency-version: 2.28.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: awexpect ... Signed-off-by: dependabot[bot] --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3d31214..84bec70 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,8 +3,8 @@ true - - + + From 1bb5785cae48a43436e6081d98bcad23dce5b97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Wed, 6 May 2026 17:27:29 +0200 Subject: [PATCH 2/2] Fix build errors --- .../aweXpect.Json/Helpers/StringExtensions.cs | 4 +-- .../Json/ExpectationJsonConverter.cs | 2 +- Source/aweXpect.Json/Json/JsonMatchType.cs | 2 +- .../Json/CustomizeJsonTests.cs | 3 ++ .../ThatJsonString.IsEqualTo.AsJson.Tests.cs | 30 +++++++++++++++++++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Source/aweXpect.Json/Helpers/StringExtensions.cs b/Source/aweXpect.Json/Helpers/StringExtensions.cs index db8bfc9..1dbcd68 100644 --- a/Source/aweXpect.Json/Helpers/StringExtensions.cs +++ b/Source/aweXpect.Json/Helpers/StringExtensions.cs @@ -40,7 +40,7 @@ public static string TrimCommonWhiteSpace(this string value) { if (lines[l][i] != commonWhiteSpace[i]) { - commonWhiteSpace = commonWhiteSpace[..i]; + commonWhiteSpace = commonWhiteSpace.Substring(0, i); break; } } @@ -50,7 +50,7 @@ public static string TrimCommonWhiteSpace(this string value) sb.Append(lines[0]); foreach (string? line in lines.Skip(1)) { - sb.Append('\n').Append(line[commonWhiteSpace.Length..]); + sb.Append('\n').Append(line.Substring(commonWhiteSpace.Length)); } return sb.ToString(); diff --git a/Source/aweXpect.Json/Json/ExpectationJsonConverter.cs b/Source/aweXpect.Json/Json/ExpectationJsonConverter.cs index 4d799d3..0c96f9a 100644 --- a/Source/aweXpect.Json/Json/ExpectationJsonConverter.cs +++ b/Source/aweXpect.Json/Json/ExpectationJsonConverter.cs @@ -43,7 +43,7 @@ public bool TryGetExpectation(JsonElement element, { string? value = element.GetString(); if (value?.StartsWith(Prefix) == true && - Guid.TryParse(value[Prefix.Length..], out Guid guid) && + Guid.TryParse(value.Substring(Prefix.Length), out Guid guid) && _expectations.TryGetValue(guid, out Expectation? expectation) && expectation is IOptionsProvider { diff --git a/Source/aweXpect.Json/Json/JsonMatchType.cs b/Source/aweXpect.Json/Json/JsonMatchType.cs index ab33e11..ba7a334 100644 --- a/Source/aweXpect.Json/Json/JsonMatchType.cs +++ b/Source/aweXpect.Json/Json/JsonMatchType.cs @@ -85,7 +85,7 @@ public async Task } /// - public string GetExpectation(string? expected, ExpectationGrammars grammar) + public string GetExpectation(string? expected, ExpectationGrammars grammars) => $"is JSON equivalent to {expected}"; /// diff --git a/Tests/aweXpect.Json.Tests/Json/CustomizeJsonTests.cs b/Tests/aweXpect.Json.Tests/Json/CustomizeJsonTests.cs index 8429fdd..a087252 100644 --- a/Tests/aweXpect.Json.Tests/Json/CustomizeJsonTests.cs +++ b/Tests/aweXpect.Json.Tests/Json/CustomizeJsonTests.cs @@ -28,6 +28,9 @@ Expected that jsonWithTrailingCommas Actual: [1, 2,] + + Expected: + [1, 2] """); } diff --git a/Tests/aweXpect.Json.Tests/ThatJsonString.IsEqualTo.AsJson.Tests.cs b/Tests/aweXpect.Json.Tests/ThatJsonString.IsEqualTo.AsJson.Tests.cs index 9bb4bde..21fec50 100644 --- a/Tests/aweXpect.Json.Tests/ThatJsonString.IsEqualTo.AsJson.Tests.cs +++ b/Tests/aweXpect.Json.Tests/ThatJsonString.IsEqualTo.AsJson.Tests.cs @@ -96,6 +96,9 @@ but it differed as "foo11": null, "foo12": null, } + + Expected: + {} """); } @@ -150,6 +153,9 @@ but it differed as "foo11": null, "foo12": null, } + + Expected: + {} """); } @@ -175,6 +181,9 @@ Expected that subject Actual: {} + + Expected: + {{expected}} """); } @@ -249,6 +258,13 @@ but it differed as Actual: { "foo": 1.1, "bar": "baz", "something": "else" } + + Expected: + { + "foo": 2.1, + "bar": "bart", + "baz": true + } """); } @@ -293,6 +309,11 @@ but it differed as $.bar had unexpected "xyz" Actual: { "foo": 1, "bar" : "xyz" } + + Expected: + { + "foo": 1 + } """); } @@ -319,6 +340,9 @@ but it differed as Actual: [1, 2] + + Expected: + [1,2,3,4] """); } @@ -349,6 +373,9 @@ but it differed as { "foo": [1, 2, 3, 4] } + + Expected: + {"foo":[1,2]} """); } @@ -374,6 +401,9 @@ Expected that subject Actual: {{subject}} + + Expected: + {} """); }