From c5706fe07a788498637befd5c30e491597d2ca90 Mon Sep 17 00:00:00 2001 From: Christer van der Meeren Date: Fri, 22 Mar 2024 13:34:53 +0100 Subject: [PATCH] Add test for non-string map key format on .NET 8 --- src/Faqt.Tests/Formatting.fs | 13 +++++++++++++ src/Faqt/Formatting.fs | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Faqt.Tests/Formatting.fs b/src/Faqt.Tests/Formatting.fs index 985eb8a..2d6a131 100644 --- a/src/Faqt.Tests/Formatting.fs +++ b/src/Faqt.Tests/Formatting.fs @@ -1107,6 +1107,19 @@ Value: """ + [] + let ``Map format with non-string keys`` () = + fun () -> ().Should().FailWith("Value", Map.ofList [ 1, "a"; 2, "b" ]) + |> assertExnMsg + """ +Subject: () +Should: FailWith +Value: + '1': a + '2': b +""" + + module YamlFormatterBuilder = diff --git a/src/Faqt/Formatting.fs b/src/Faqt/Formatting.fs index 75e0a4d..9d2c4e7 100644 --- a/src/Faqt/Formatting.fs +++ b/src/Faqt/Formatting.fs @@ -409,7 +409,6 @@ type YamlFormatterBuilder = private { .WithUnionUnwrapSingleFieldCases() .WithUnwrapOption(false) #if NET8_0_OR_GREATER - // TODO: Test when upgrading test project to .NET 8 .WithMapFormat(MapFormat.Object) #endif )