Skip to content

Commit

Permalink
Make rendering of char consistent with string (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Feb 14, 2025
1 parent d099110 commit 0f0b1ca
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 65 deletions.
26 changes: 13 additions & 13 deletions docs/dates.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var target = new DateTimeTarget

await Verify(target);
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1044-L1063' title='Snippet source file'>snippet source</a> | <a href='#snippet-Date' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1052-L1071' title='Snippet source file'>snippet source</a> | <a href='#snippet-Date' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Results in the following:
Expand Down Expand Up @@ -70,7 +70,7 @@ settings.DontScrubDateTimes();

return Verify(target, settings);
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1708-L1720' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubDateTimes' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1716-L1728' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubDateTimes' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -87,7 +87,7 @@ var target = new
return Verify(target)
.DontScrubDateTimes();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1726-L1736' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubDateTimesFluent' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1734-L1744' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubDateTimesFluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -100,7 +100,7 @@ return Verify(target)
public static void ModuleInitializer() =>
VerifierSettings.DontScrubDateTimes();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1794-L1800' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubDateTimesGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1802-L1808' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubDateTimesGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -124,7 +124,7 @@ settings.DisableDateCounting();

return Verify(target, settings);
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1755-L1767' title='Snippet source file'>snippet source</a> | <a href='#snippet-DisableDateCounting' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1763-L1775' title='Snippet source file'>snippet source</a> | <a href='#snippet-DisableDateCounting' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -141,7 +141,7 @@ var target = new
return Verify(target)
.DisableDateCounting();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1773-L1783' title='Snippet source file'>snippet source</a> | <a href='#snippet-DisableDateCountingFluent' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1781-L1791' title='Snippet source file'>snippet source</a> | <a href='#snippet-DisableDateCountingFluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -154,7 +154,7 @@ return Verify(target)
public static void ModuleInitializer() =>
VerifierSettings.DisableDateCounting();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1742-L1748' title='Snippet source file'>snippet source</a> | <a href='#snippet-DisableDateCountingGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1750-L1756' title='Snippet source file'>snippet source</a> | <a href='#snippet-DisableDateCountingGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -201,7 +201,7 @@ public Task ScrubInlineDateTimesInstance()
settings);
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1678-L1690' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineDateTimesInstance' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1686-L1698' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineDateTimesInstance' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -215,7 +215,7 @@ public Task ScrubInlineDateTimesFluent() =>
Verify("content 2020-10-20 content")
.ScrubInlineDateTimes("yyyy-MM-dd");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1669-L1676' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineDateTimesFluent' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1677-L1684' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineDateTimesFluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -231,7 +231,7 @@ public static class ModuleInitializer
VerifierSettings.ScrubInlineDateTimes("yyyy-MM-dd");
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1657-L1666' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineDateTimesGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1665-L1674' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineDateTimesGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -252,7 +252,7 @@ settings.AddNamedDateTime(new(2030, 1, 2), "instanceNamedDateTime");
settings.AddNamedDateTimeOffset(new DateTime(2030, 1, 2), "instanceNamedTimeOffset");
await Verify(target, settings);
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1226-L1235' title='Snippet source file'>snippet source</a> | <a href='#snippet-NamedDatesAndTimesInstance' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1234-L1243' title='Snippet source file'>snippet source</a> | <a href='#snippet-NamedDatesAndTimesInstance' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -267,7 +267,7 @@ await Verify(target)
.AddNamedDateTime(new(2030, 1, 2), "instanceNamedDateTime")
.AddNamedDateTimeOffset(new DateTime(2030, 1, 2), "instanceNamedTimeOffset");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1183-L1191' title='Snippet source file'>snippet source</a> | <a href='#snippet-NamedDatesAndTimesFluent' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1191-L1199' title='Snippet source file'>snippet source</a> | <a href='#snippet-NamedDatesAndTimesFluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -285,7 +285,7 @@ public static void NamedDatesAndTimesGlobal()
VerifierSettings.AddNamedDateTimeOffset(new(new(2030, 1, 1)), "namedDateTimeOffset");
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1138-L1149' title='Snippet source file'>snippet source</a> | <a href='#snippet-NamedDatesAndTimesGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1146-L1157' title='Snippet source file'>snippet source</a> | <a href='#snippet-NamedDatesAndTimesGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
14 changes: 7 additions & 7 deletions docs/guids.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var target = new GuidTarget

await Verify(target);
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2057-L2070' title='Snippet source file'>snippet source</a> | <a href='#snippet-guid' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2065-L2078' title='Snippet source file'>snippet source</a> | <a href='#snippet-guid' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Results in the following:
Expand Down Expand Up @@ -56,7 +56,7 @@ var settings = new VerifySettings();
settings.DontScrubGuids();
await Verify(target, settings);
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L671-L677' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubGuids' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L679-L685' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubGuids' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -68,7 +68,7 @@ await Verify(target, settings);
await Verify(target)
.DontScrubGuids();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L685-L690' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubGuidsFluent' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L693-L698' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubGuidsFluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -79,7 +79,7 @@ await Verify(target)
```cs
VerifierSettings.DontScrubGuids();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1586-L1590' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubGuidsGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1594-L1598' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontScrubGuidsGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -103,7 +103,7 @@ public Task ScrubInlineGuidsInstance()
settings);
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1642-L1654' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineGuidsInstance' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1650-L1662' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineGuidsInstance' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -117,7 +117,7 @@ public Task ScrubInlineGuidsFluent() =>
Verify("content 651ad409-fc30-4b12-a47e-616d3f953e4c content")
.ScrubInlineGuids();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1633-L1640' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineGuidsFluent' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1641-L1648' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineGuidsFluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -133,7 +133,7 @@ public static class ModuleInitializer
VerifierSettings.ScrubInlineGuids();
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1621-L1630' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineGuidsGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1629-L1638' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScrubInlineGuidsGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
8 changes: 4 additions & 4 deletions docs/members-throw.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Task CustomExceptionPropFluent()
.IgnoreMembersThatThrow<CustomException>();
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3735-L3754' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrow' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3743-L3762' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrow' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Or globally:
Expand All @@ -45,7 +45,7 @@ Or globally:
```cs
VerifierSettings.IgnoreMembersThatThrow<CustomException>();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3729-L3733' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrowGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3737-L3741' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrowGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Result:
Expand Down Expand Up @@ -82,7 +82,7 @@ public Task ExceptionMessagePropFluent()
.IgnoreMembersThatThrow<Exception>(_ => _.Message == "Ignore");
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2400-L2421' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrowExpression' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2408-L2429' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrowExpression' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Or globally:
Expand All @@ -92,7 +92,7 @@ Or globally:
```cs
VerifierSettings.IgnoreMembersThatThrow<Exception>(_ => _.Message == "Ignore");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2393-L2397' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrowExpressionGlobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2401-L2405' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreMembersThatThrowExpressionGlobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Result:
Expand Down
4 changes: 2 additions & 2 deletions docs/named-tuples.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Given a method that returns a named tuple:
static (bool Member1, string Member2, string Member3) MethodWithNamedTuple() =>
(true, "A", "B");
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1992-L1997' title='Snippet source file'>snippet source</a> | <a href='#snippet-MethodWithNamedTuple' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2000-L2005' title='Snippet source file'>snippet source</a> | <a href='#snippet-MethodWithNamedTuple' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Can be verified:
Expand All @@ -29,7 +29,7 @@ Can be verified:
```cs
await VerifyTuple(() => MethodWithNamedTuple());
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1986-L1990' title='Snippet source file'>snippet source</a> | <a href='#snippet-VerifyTuple' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1994-L1998' title='Snippet source file'>snippet source</a> | <a href='#snippet-VerifyTuple' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Resulting in:
Expand Down
6 changes: 3 additions & 3 deletions docs/obsolete-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Task WithObsoleteProp()
return Verify(target);
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3882-L3903' title='Snippet source file'>snippet source</a> | <a href='#snippet-WithObsoleteProp' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3890-L3911' title='Snippet source file'>snippet source</a> | <a href='#snippet-WithObsoleteProp' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Result:
Expand Down Expand Up @@ -79,7 +79,7 @@ public Task WithObsoletePropIncludedFluent()
.IncludeObsoletes();
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3853-L3880' title='Snippet source file'>snippet source</a> | <a href='#snippet-WithObsoletePropIncluded' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3861-L3888' title='Snippet source file'>snippet source</a> | <a href='#snippet-WithObsoletePropIncluded' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Or globally:
Expand All @@ -89,7 +89,7 @@ Or globally:
```cs
VerifierSettings.IncludeObsoletes();
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3847-L3851' title='Snippet source file'>snippet source</a> | <a href='#snippet-WithObsoletePropIncludedGlobally' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3855-L3859' title='Snippet source file'>snippet source</a> | <a href='#snippet-WithObsoletePropIncludedGlobally' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Result:
Expand Down
2 changes: 1 addition & 1 deletion docs/ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Task DontOrderDictionaries()
.DontSortDictionaries();
}
```
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L138-L160' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontOrderDictionaries-1' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L146-L168' title='Snippet source file'>snippet source</a> | <a href='#snippet-DontOrderDictionaries-1' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
Loading

0 comments on commit 0f0b1ca

Please sign in to comment.