chore: add test with custom type

This commit is contained in:
Dmitriy Pleshevskiy 2022-07-26 23:36:04 +03:00
parent 62e38ccf6f
commit 38e035037c

View file

@ -16,6 +16,7 @@ where
#[cfg(test)]
mod tests {
use super::*;
use crate::structs::Pair;
#[test]
fn should_parse_empty_string_as_none() {
@ -34,4 +35,13 @@ mod tests {
_ => unreachable!(),
}
}
#[test]
fn should_parse_pair() {
let estr = EString::from("1+2");
match estr.parse::<Option<Pair<i32, '+', i32>>>() {
Ok(res) => assert_eq!(res, Some(Pair(1, 2))),
_ => unreachable!(),
}
}
}