Fix tests

Upstream changes are described here: https://github.com/jhy/jsoup/issues/1278

They are effectively irrelevant as YT removes the ``"``/attributes anyway.
This commit is contained in:
litetex 2025-02-17 22:09:44 +01:00
parent 7e21002838
commit c4056f5d5c
No known key found for this signature in database
GPG Key ID: 525B43E6039B3689

View File

@ -11,7 +11,7 @@ import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class YoutubeDescriptionHelperTest { class YoutubeDescriptionHelperTest {
private static void assertRunsToHtml(final String expectedHtml, private static void assertRunsToHtml(final String expectedHtml,
final List<Run> openers, final List<Run> openers,
@ -32,9 +32,9 @@ public class YoutubeDescriptionHelperTest {
} }
@Test @Test
public void testNoRuns() { void testNoRuns() {
assertRunsToHtml( assertRunsToHtml(
"abc *a* _c_ &lt;br&gt; <br> &lt;a href=\"#\"&gt;test&lt;/a&gt; &nbsp;&amp;amp;", "abc *a* _c_ &lt;br&gt; <br> &lt;a href=&quot;#&quot;&gt;test&lt;/a&gt; &nbsp;&amp;amp;",
List.of(), List.of(),
List.of(), List.of(),
"abc *a* _c_ <br>\u00a0\n\u00a0<a href=\"#\">test</a> &amp;" "abc *a* _c_ <br>\u00a0\n\u00a0<a href=\"#\">test</a> &amp;"
@ -42,7 +42,7 @@ public class YoutubeDescriptionHelperTest {
} }
@Test @Test
public void testNormalRuns() { void testNormalRuns() {
assertRunsToHtml( assertRunsToHtml(
"<A>hel<B>lo </B>nic</A>e <C>test</C>", "<A>hel<B>lo </B>nic</A>e <C>test</C>",
List.of(new Run("<A>", "</A>", 0), new Run("<B>", "</B>", 3), List.of(new Run("<A>", "</A>", 0), new Run("<B>", "</B>", 3),
@ -54,7 +54,7 @@ public class YoutubeDescriptionHelperTest {
} }
@Test @Test
public void testOverlappingRuns() { void testOverlappingRuns() {
assertRunsToHtml( assertRunsToHtml(
"01<A>23<B>45</B></A><B>67</B>89", "01<A>23<B>45</B></A><B>67</B>89",
List.of(new Run("<A>", "</A>", 2), new Run("<B>", "</B>", 4)), List.of(new Run("<A>", "</A>", 2), new Run("<B>", "</B>", 4)),
@ -64,7 +64,7 @@ public class YoutubeDescriptionHelperTest {
} }
@Test @Test
public void testTransformingRuns() { void testTransformingRuns() {
final Function<String, String> tA = content -> "whatever"; final Function<String, String> tA = content -> "whatever";
final Function<String, String> tD final Function<String, String> tD
= content -> Integer.parseInt(content) % 2 == 0 ? "even" : "odd"; = content -> Integer.parseInt(content) % 2 == 0 ? "even" : "odd";