From 70e2ed8c82c521c1e4ea2dff4e46b96b3d298028 Mon Sep 17 00:00:00 2001 From: Jan Lukas Gernert Date: Fri, 31 Mar 2023 07:09:13 +0200 Subject: [PATCH] 3 more tests --- .../tests/readability/mozilla-2/expected.html | 97 + .../tests/readability/mozilla-2/source.html | 408 + resources/tests/readability/msn/expected.html | 22 + resources/tests/readability/msn/source.html | 13010 ++++++++++++++++ .../normalize-spaces/expected.html | 26 + .../readability/normalize-spaces/source.html | 35 + src/full_text_parser/readability/tests.rs | 15 + 7 files changed, 13613 insertions(+) create mode 100644 resources/tests/readability/mozilla-2/expected.html create mode 100644 resources/tests/readability/mozilla-2/source.html create mode 100644 resources/tests/readability/msn/expected.html create mode 100644 resources/tests/readability/msn/source.html create mode 100644 resources/tests/readability/normalize-spaces/expected.html create mode 100644 resources/tests/readability/normalize-spaces/source.html diff --git a/resources/tests/readability/mozilla-2/expected.html b/resources/tests/readability/mozilla-2/expected.html new file mode 100644 index 0000000..47754d0 --- /dev/null +++ b/resources/tests/readability/mozilla-2/expected.html @@ -0,0 +1,97 @@ +
+
+
+ +

Get to know the features that make it the most complete browser for building the Web.

+
+
    +
  • + + Screenshot + +

    WebIDE

    +

    Develop, deploy and debug Firefox OS apps directly in your browser, or on a Firefox OS device, with this tool that replaces App Manager.

    + Learn more about WebIDE + +
  • +
  • + + Screenshot + +

    Valence

    +

    Develop and debug your apps across multiple browsers and devices with this powerful extension that comes pre-installed with Firefox Developer Edition.

    + Learn more about Valence + +
  • +
+
+

Important: Sync your new profile

+

+ Developer Edition comes with a new profile so you can run it alongside other versions of Firefox. To access your bookmarks, browsing history and more, you need to sync the profile with your existing Firefox Account, or create a new one. + Learn more +

+
+
+ +
+
+

Features and tools

+
+ +
+
diff --git a/resources/tests/readability/mozilla-2/source.html b/resources/tests/readability/mozilla-2/source.html new file mode 100644 index 0000000..31f30a6 --- /dev/null +++ b/resources/tests/readability/mozilla-2/source.html @@ -0,0 +1,408 @@ + + + + + + + + + + + Welcome to Firefox Developer Edition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+ Mozilla + + +

Firefox Developer Edition

+ + + + +
+ + + + +
+
+
+

Welcome to Firefox Developer Edition

+

Get to know the features that make it the most complete browser for building the Web.

+
+
    +
  • + + Screenshot + +

    WebIDE

    +

    Develop, deploy and debug Firefox OS apps directly in your browser, or on a Firefox OS device, with this tool that replaces App Manager.

    + Learn more about WebIDE +
    +
    +
    +
  • +
  • + + Screenshot + +

    Valence

    +

    Develop and debug your apps across multiple browsers and devices with this powerful extension that comes pre-installed with Firefox Developer Edition.

    + Learn more about Valence +
    +
    +
    +
  • +
+
+

Important: Sync your new profile

+

+ Developer Edition comes with a new profile so you can run it alongside other versions of Firefox. To access your bookmarks, browsing history and more, you need to sync the profile with your existing Firefox Account, or create a new one. + Learn more +

+
+
+ +
+
+
+

Features and tools

+
+ +
+
+
+ + + +
+ + +
+ + + + + + diff --git a/resources/tests/readability/msn/expected.html b/resources/tests/readability/msn/expected.html new file mode 100644 index 0000000..55f6fd5 --- /dev/null +++ b/resources/tests/readability/msn/expected.html @@ -0,0 +1,22 @@ +
+
+

+ + + <span style="font-size:13px;">Nintendo/Apple</span> + + + © Provided by Business Insider Inc + Nintendo/Apple + + + Nintendo and Apple shocked the world earlier this year by announcing "Super Mario Run," the legendary gaming company's first foray into mobile gaming. It's a Mario game you can play on your phone with just one hand, so what's not to love?

+

Thankfully, now we know when you can get it and for how much: "Super Mario Run" will launch on iPhone and iPad on December 15, for a flat fee of $9.99. You can play a sample of the game modes for free, but unlike most other mobile games that let you download for free but require money to keep playing, or access parts of the game, you can pay $10 to get everything right away.

+

In case you haven't heard, "Super Mario Run" is essentially a regular, side-scrolling "Super Mario" game with one key difference: You don't control Mario's movement. He runs automatically and all you do is tap the screen to jump.

+

The name and basic idea might sound like one of those endless score attack games like "Temple Run," but that's not the case. "Super Mario Run" is divided into hand-crafted levels with a clear end-point like any other Mario game, meaning you're essentially getting the Mario experience for $10 without needing to control his movement.

+

$10 might seem like a bit much compared to the $0 people pay for most mobile games, but it's possible the game has $10 worth of levels to play in it. It's also not iPhone exclusive, but the Android version will launch at a later, currently unknown date.

+

To see "Super Mario Run" in action, check out the footage below:

+
+ +
+
diff --git a/resources/tests/readability/msn/source.html b/resources/tests/readability/msn/source.html new file mode 100644 index 0000000..be55bf3 --- /dev/null +++ b/resources/tests/readability/msn/source.html @@ -0,0 +1,13010 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Nintendo's first iPhone game will launch in December for $10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + +
+ + + + + +
+ + +
+ +
+
+

+ Nintendo's first iPhone game will launch in December for $10 +

+
+ +
+
+
+ + + + +
+ + +
+
+ + +
+
+ + + + + +
+ + +
+
+
+ + + + + + +
+
+

+ + + <span style="font-size:13px;">Nintendo/Apple</span> + + + © Provided by Business Insider Inc + Nintendo/Apple + + + Nintendo and Apple shocked the world earlier this year by announcing "Super Mario Run," the legendary gaming company's first foray into mobile gaming. It's a Mario game you can play on your phone with just one hand, so what's not to love?

+

Thankfully, now we know when you can get it and for how much: "Super Mario Run" will launch on iPhone and iPad on December 15, for a flat fee of $9.99. You can play a sample of the game modes for free, but unlike most other mobile games that let you download for free but require money to keep playing, or access parts of the game, you can pay $10 to get everything right away.

+

In case you haven't heard, "Super Mario Run" is essentially a regular, side-scrolling "Super Mario" game with one key difference: You don't control Mario's movement. He runs automatically and all you do is tap the screen to jump.

+

The name and basic idea might sound like one of those endless score attack games like "Temple Run," but that's not the case. "Super Mario Run" is divided into hand-crafted levels with a clear end-point like any other Mario game, meaning you're essentially getting the Mario experience for $10 without needing to control his movement.

+

$10 might seem like a bit much compared to the $0 people pay for most mobile games, but it's possible the game has $10 worth of levels to play in it. It's also not iPhone exclusive, but the Android version will launch at a later, currently unknown date.

+

To see "Super Mario Run" in action, check out the footage below:

+
+


+
+
+ +
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+ +
+ + + +
+ + + + +
+ + + + + Feedback + + + + + + +
+
+
+
+
+
+
+
+
+ +
+ +
+

Report inappropriate content

+
+
+
+
Sorry!
+
There was a problem. Please try again.
+
+
+

+ Help us maintain a healthy and vibrant community by reporting any illegal or inappropriate behavior that violates MSN’s Code of Conduct. +

+
+ + + + + + + + + + +
+
+
+ + +
+
+ + Leave your comment + +
+
+
+ + + + + + +
+ + +
+
+ +
+ +
+ + + + +
+
+ +

Found the story interesting?

+

Like us on Facebook to see similar stories

+
+
+
+
+
+
+ +
+ +
+

Send Feedback

+ + +
+
+

We appreciate your input!

+
+
+
+ +
    +
  • +

    I'm having problems with Top Destinations

    +
  • +
  • +

    I'm having issues searching

    +
  • +
  • +

    I'm having problems with Featured Apps

    +
  • +
  • +

    My Topics feedback

    +
  • +
  • +

    Other

    +
  • +
+
+
+ + +
+
+
+
+

Please give an overall site rating:

+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+ + +
+ + + +
+ +
+ +
+ +
+
+
+ +

Make MSN my homepage

+
    +
  • + On the toolbar, click Firefox Then, click Preferences. +
    + On the toolbar, click Firefox Then, click Preferences. +
    +
  • +
  • + In the Preferences window, select General. +
    + In the Preferences window, select General. +
    +
  • +
  • + In the text box next to Home page, simply type www.msn.com. +
    + In the text box next to Home page, simply type www.msn.com. +
    +
  • +
+
+ +
+ + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + diff --git a/resources/tests/readability/normalize-spaces/expected.html b/resources/tests/readability/normalize-spaces/expected.html new file mode 100644 index 0000000..e7abead --- /dev/null +++ b/resources/tests/readability/normalize-spaces/expected.html @@ -0,0 +1,26 @@ +
+

Lorem

+

+ Lorem + ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tab here + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse + cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non + proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +

+

Foo

+

+ Tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation + + + + + ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse + cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non + proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +

+
diff --git a/resources/tests/readability/normalize-spaces/source.html b/resources/tests/readability/normalize-spaces/source.html new file mode 100644 index 0000000..b230798 --- /dev/null +++ b/resources/tests/readability/normalize-spaces/source.html @@ -0,0 +1,35 @@ + + + + + Normalize space test + + +
+

Lorem

+
+ Lorem + ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tab here + incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse + cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non + proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +
+

Foo

+
+ Tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation + + + + + ullamco laboris nisi ut aliquip ex ea commodo + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse + cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non + proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +
+
+ + diff --git a/src/full_text_parser/readability/tests.rs b/src/full_text_parser/readability/tests.rs index 74956fc..da9746a 100644 --- a/src/full_text_parser/readability/tests.rs +++ b/src/full_text_parser/readability/tests.rs @@ -357,6 +357,21 @@ async fn mozilla_1() { run_test("mozilla-1").await } +#[tokio::test] +async fn mozilla_2() { + run_test("mozilla-2").await +} + +#[tokio::test] +async fn msn() { + run_test("msn").await +} + +#[tokio::test] +async fn normalize_spaces() { + run_test("normalize-spaces").await +} + #[tokio::test] async fn webmd_1() { run_test("webmd-1").await