[tests/mfm] Code cleanup, improve MfmQuoteNode equality check

This commit is contained in:
Laura Hausmann 2024-09-07 02:18:15 +02:00
parent 5889f3cd26
commit 32c4eaf18a
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -235,32 +235,34 @@ public class MfmTests
[TestMethod]
public void TestQuoteInline()
{
const string input = """
this is plain text > this is not a quote >this is also not a quote
> this is a quote
> this is part of the same quote
>this too
this is some plain text inbetween
>this is a second quote
> this is part of the second quote
const string input =
"""
this is plain text > this is not a quote >this is also not a quote
> this is a quote
> this is part of the same quote
>this too
> this is a third quote
and this is some plain text to close it off
""";
this is some plain text inbetween
>this is a second quote
> this is part of the second quote
const string canonical = """
this is plain text > this is not a quote >this is also not a quote
> this is a quote
> this is part of the same quote
> this too
this is some plain text inbetween
> this is a second quote
> this is part of the second quote
> this is a third quote
and this is some plain text to close it off
""";
> this is a third quote
and this is some plain text to close it off
""";
const string canonical =
"""
this is plain text > this is not a quote >this is also not a quote
> this is a quote
> this is part of the same quote
> this too
this is some plain text inbetween
> this is a second quote
> this is part of the second quote
> this is a third quote
and this is some plain text to close it off
""";
// @formatter:off
List<MfmNode> expected =
@ -390,6 +392,13 @@ public class MfmTests
if (ax.Silent != bx.Silent) return false;
break;
}
case MfmQuoteNode ax:
{
var bx = (MfmQuoteNode)b;
if (ax.FollowedByEof != bx.FollowedByEof) return false;
if (ax.FollowedByQuote != bx.FollowedByQuote) return false;
break;
}
case MfmFnNode ax:
{
var bx = (MfmFnNode)b;