diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..0289217 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,19 @@ +name: Tests +on: [push, workflow_dispatch] +jobs: + Documentation-Tests: + runs-on: ubuntu-latest + env: + RUSTDOCFLAGS: -D warnings + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cargo Doc + run: cargo doc --features std + Unit-Tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cargo Test + run: cargo test -- --nocapture diff --git a/src/minifier/html.rs b/src/minifier/html.rs index 5e4ffe6..f701795 100644 --- a/src/minifier/html.rs +++ b/src/minifier/html.rs @@ -573,9 +573,14 @@ mod tests { expected: "

hi

", }, Tester { - name: "Includes whitespace in textual comments", + name: "Minimises whitespace in textual tags", source: "

This has weird whitespace!!!\n

", - expected: "

This has weird whitespace!!!\n

", + expected: "

This has weird whitespace!!!

", + }, + Tester { + name: "Includes whitespace in preformatted tags", + source: "
 This has   weird whitespace!!!\n
", + expected: "
 This has   weird whitespace!!!\n
", }, Tester { name: "Element properties",