1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pub use self::basic::*;
pub(crate) mod basic;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_parser_default() {
let data = "\"abc\"";
let result = parse_string::<()>(data);
assert_eq!(result, Ok(("", String::from("abc"))))
}
#[test]
fn test_other_parser() {
let data = "\"tab:\\tafter tab, newline:\\nnew line, quote: \\\", emoji: \\u{1F602}, newline:\\nescaped whitespace: \\ abc\"";
let result = parse_string::<()>(data);
assert_eq!(
result,
Ok((
"",
String::from("tab:\tafter tab, newline:\nnew line, quote: \", emoji: 😂, newline:\nescaped whitespace: abc")
))
)
}
}