aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-03 15:59:37 +0100
committerGitHub <noreply@github.com>2021-12-03 15:59:37 +0100
commitc9c8fcf4daa594c7b3ffe08a64f563f152c22f29 (patch)
tree6ec05fbe26fc4992aa2046f0760327b0c7ff8dc1
parent5e69d3391b478dda186c8d3e94502537d6895a13 (diff)
Fix typo and add example (#9)
-rw-r--r--examples/tokenize.rs9
-rw-r--r--tests/test_html5lib.rs2
2 files changed, 10 insertions, 1 deletions
diff --git a/examples/tokenize.rs b/examples/tokenize.rs
new file mode 100644
index 0000000..9a039c3
--- /dev/null
+++ b/examples/tokenize.rs
@@ -0,0 +1,9 @@
+//! Let's you easily try out the tokenizer with e.g.
+//! printf '<h1>Hello world!</h1>' | cargo run --example=tokenize
+use html5gum::{BufReadReader, Tokenizer};
+
+fn main() {
+ for token in Tokenizer::new(BufReadReader::new(std::io::stdin().lock())).flatten() {
+ println!("{:?}", token);
+ }
+}
diff --git a/tests/test_html5lib.rs b/tests/test_html5lib.rs
index 540388f..652a72d 100644
--- a/tests/test_html5lib.rs
+++ b/tests/test_html5lib.rs
@@ -5,7 +5,7 @@ use std::{collections::BTreeMap, fs::File, io::BufReader, path::Path};
#[cfg(not(feature = "integration-tests"))]
compile_error!(
- "integration tests need the integration-tests feature enabled. Run cargo tests --all-features"
+ "integration tests need the integration-tests feature enabled. Run cargo test --all-features"
);
struct ExpectedOutputTokens(Vec<Token>);