2022-05-04 08:22:58 +03:00
|
|
|
#![deny(warnings)]
|
2022-05-25 09:23:35 +03:00
|
|
|
#![allow(clippy::if_same_then_else)]
|
2022-04-04 07:12:45 +03:00
|
|
|
#![allow(clippy::needless_update)]
|
2022-05-07 19:56:38 +03:00
|
|
|
#![allow(clippy::redundant_clone)]
|
|
|
|
#![allow(clippy::while_let_on_iterator)]
|
2022-04-04 07:12:45 +03:00
|
|
|
|
2022-10-18 03:20:35 +03:00
|
|
|
use std::path::PathBuf;
|
2022-05-03 05:49:06 +03:00
|
|
|
|
2022-10-18 03:20:35 +03:00
|
|
|
use common::{document_dom_visualizer, document_span_visualizer};
|
|
|
|
use swc_html_parser::parser::ParserConfig;
|
2022-04-04 07:12:45 +03:00
|
|
|
|
2022-10-18 03:20:35 +03:00
|
|
|
use crate::common::document_test;
|
2022-04-28 20:27:39 +03:00
|
|
|
|
2022-10-18 03:20:35 +03:00
|
|
|
#[path = "common/mod.rs"]
|
|
|
|
mod common;
|
2022-04-28 20:27:39 +03:00
|
|
|
|
2022-05-05 16:00:25 +03:00
|
|
|
#[testing::fixture("tests/fixture/**/*.html")]
|
2022-04-28 20:27:39 +03:00
|
|
|
fn pass(input: PathBuf) {
|
2022-05-12 05:58:51 +03:00
|
|
|
document_test(
|
2022-04-28 20:27:39 +03:00
|
|
|
input,
|
|
|
|
ParserConfig {
|
|
|
|
..Default::default()
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2022-05-05 16:00:25 +03:00
|
|
|
#[testing::fixture("tests/fixture/**/*.html")]
|
2022-04-28 20:27:39 +03:00
|
|
|
fn span_visualizer(input: PathBuf) {
|
2022-05-12 05:58:51 +03:00
|
|
|
document_span_visualizer(
|
|
|
|
input,
|
|
|
|
ParserConfig {
|
|
|
|
..Default::default()
|
|
|
|
},
|
2022-10-18 03:20:35 +03:00
|
|
|
false,
|
2022-05-12 05:58:51 +03:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[testing::fixture("tests/fixture/**/*.html")]
|
|
|
|
fn dom_visualizer(input: PathBuf) {
|
|
|
|
document_dom_visualizer(
|
2022-04-28 20:27:39 +03:00
|
|
|
input,
|
|
|
|
ParserConfig {
|
|
|
|
..Default::default()
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|