swc/crates/swc_html_parser/tests/fixture.rs

47 lines
981 B
Rust
Raw Normal View History

2022-05-04 08:22:58 +03:00
#![deny(warnings)]
#![allow(clippy::if_same_then_else)]
2022-04-04 07:12:45 +03:00
#![allow(clippy::needless_update)]
#![allow(clippy::redundant_clone)]
#![allow(clippy::while_let_on_iterator)]
2022-04-04 07:12:45 +03:00
use std::path::PathBuf;
2022-05-03 05:49:06 +03:00
use common::{document_dom_visualizer, document_span_visualizer};
use swc_html_parser::parser::ParserConfig;
2022-04-04 07:12:45 +03:00
use crate::common::document_test;
2022-04-28 20:27:39 +03:00
#[path = "common/mod.rs"]
mod common;
2022-04-28 20:27:39 +03:00
#[testing::fixture("tests/fixture/**/*.html")]
2022-04-28 20:27:39 +03:00
fn pass(input: PathBuf) {
document_test(
2022-04-28 20:27:39 +03:00
input,
ParserConfig {
..Default::default()
},
)
}
#[testing::fixture("tests/fixture/**/*.html")]
2022-04-28 20:27:39 +03:00
fn span_visualizer(input: PathBuf) {
document_span_visualizer(
input,
ParserConfig {
..Default::default()
},
false,
)
}
#[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()
},
)
}