From 32c4eaf18ad75d1af07c9a6da8231206804bc2dc Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 7 Sep 2024 02:18:15 +0200 Subject: [PATCH] [tests/mfm] Code cleanup, improve MfmQuoteNode equality check --- Iceshrimp.Tests/Parsing/MfmTests.cs | 55 +++++++++++++++++------------ 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/Iceshrimp.Tests/Parsing/MfmTests.cs b/Iceshrimp.Tests/Parsing/MfmTests.cs index a39cd12f..435fe203 100644 --- a/Iceshrimp.Tests/Parsing/MfmTests.cs +++ b/Iceshrimp.Tests/Parsing/MfmTests.cs @@ -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 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;