aboutsummaryrefslogtreecommitdiff
path: root/vendor/utf8parse/tests/utf-8-demo.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
committerValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
commita990de90fe41456a23e58bd087d2f107d321f3a1 (patch)
tree15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/utf8parse/tests/utf-8-demo.rs
parent3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff)
downloadfparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz
fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip
Deleted vendor folder
Diffstat (limited to 'vendor/utf8parse/tests/utf-8-demo.rs')
-rw-r--r--vendor/utf8parse/tests/utf-8-demo.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/vendor/utf8parse/tests/utf-8-demo.rs b/vendor/utf8parse/tests/utf-8-demo.rs
deleted file mode 100644
index 51df492..0000000
--- a/vendor/utf8parse/tests/utf-8-demo.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-use utf8parse::{Parser, Receiver};
-
-static UTF8_DEMO: &[u8] = include_bytes!("UTF-8-demo.txt");
-
-#[derive(Debug, PartialEq)]
-struct StringWrapper(String);
-
-impl Receiver for StringWrapper {
- fn codepoint(&mut self, c: char) {
- self.0.push(c);
- }
-
- fn invalid_sequence(&mut self) {}
-}
-
-#[test]
-fn utf8parse_test() {
- let mut parser = Parser::new();
-
- // utf8parse implementation
- let mut actual = StringWrapper(String::new());
-
- for byte in UTF8_DEMO {
- parser.advance(&mut actual, *byte)
- }
-
- // standard library implementation
- let expected = String::from_utf8_lossy(UTF8_DEMO);
-
- assert_eq!(actual.0, expected);
-}