Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MarkupString.Tests/Ansi/MarkdownRenderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public async Task TextTheVocabularyMarksIsKept()
[Test]
public void PlainTextReadsBackAsItself()
{
var gen = Gen.OneOfConst(Pieces).Array[0, 12].Select(string.Concat);
var gen = Gen.OneOf(Pieces).Array[0, 12].Select(string.Concat);
Check.Sample(gen, text =>
{
var markdown = Render(MarkupText.Plain(text));
Expand All @@ -318,7 +318,7 @@ public void PlainTextReadsBackAsItself()
public void StyledTextReadsBackAsItsWords()
{
var styles = new[] { Bold, Italic, AnsiMarkup.Create(strikeThrough: true), AnsiMarkup.Create(bold: true, italic: true) };
var gen = Gen.Select(Gen.OneOfConst(Pieces).Array[1, 4].Select(string.Concat), Gen.Int[-1, styles.Length - 1])
var gen = Gen.Select(Gen.OneOf(Pieces).Array[1, 4].Select(string.Concat), Gen.Int[-1, styles.Length - 1])
.Array[1, 5]
.Select(parts => MarkupText.Join(MarkupText.Plain(" "), parts.Select(part => part.Item2 < 0 ? MarkupText.Plain(part.Item1) : MarkupText.Wrap(styles[part.Item2], part.Item1))));
Check.Sample(gen, text =>
Expand Down
6 changes: 3 additions & 3 deletions MarkupString.Tests/MarkupString.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<NoWarn>TUnit0038;TUnitAssertions0002</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CsCheck" Version="4.9.1" />
<PackageReference Include="TUnit" Version="1.75.0" />
<PackageReference Include="CsCheck" Version="5.0.0" />
<PackageReference Include="TUnit" Version="1.76.28" />
<!-- A GitHub-flavoured Markdown reader, so the Markdown tests check what a reader makes of the output
rather than only the characters written. -->
<PackageReference Include="Markdig" Version="1.4.1" />
<PackageReference Include="Markdig" Version="1.5.0" />
<!-- Verify.TUnit carries a floor on TUnit.Core. Bump the two together: if NuGet lifts
TUnit.Core past the TUnit.Engine this project asks for, the split versions fault at
startup with MissingFieldException rather than failing to restore. -->
Expand Down
8 changes: 4 additions & 4 deletions MarkupString.Tests/Properties/RoundTripProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class RoundTripProperties
/// Links are rare (the no-link case is weighted five to one) and cover both kinds, an
/// unsafe scheme, a hint, and a target that needs encoding.
/// </summary>
private static readonly Gen<(string? Url, string? Text, LinkKind Kind)> GenLink = Gen.OneOfConst(
private static readonly Gen<(string? Url, string? Text, LinkKind Kind)> GenLink = Gen.OneOf(
((string?)null, (string?)null, LinkKind.Url),
(null, null, LinkKind.Url),
(null, null, LinkKind.Url),
Expand Down Expand Up @@ -105,8 +105,8 @@ public class RoundTripProperties
clear: flag[8]));

private static readonly Gen<IMarkup> GenHtmlMarkup = Gen.Select(
Gen.OneOfConst("b", "i", "u", "s", "send", "div"),
Gen.OneOfConst<string?>(null, null, "class=\"x\"", "href=\"north\" hint=\"Go north\""),
Gen.OneOf("b", "i", "u", "s", "send", "div"),
Gen.OneOf<string?>(null, null, "class=\"x\"", "href=\"north\" hint=\"Go north\""),
(tag, attributes) => (IMarkup)HtmlMarkup.Create(tag, attributes));

private static readonly Gen<MarkupSet> GenSet =
Expand Down Expand Up @@ -221,7 +221,7 @@ public void PadWithTruncation_NeverExceedsTheRequestedWidth()
};

Check.Sample(
Gen.Select(GenMarkupText, Gen.Int[0, 60], Gen.OneOfConst('.', '-', '*', ' ')),
Gen.Select(GenMarkupText, Gen.Int[0, 60], Gen.OneOf('.', '-', '*', ' ')),
property, seed: Seed, iter: 5000);
}

Expand Down
Loading