Add ParseMode serialization tests

This commit is contained in:
Waffle 2019-09-06 01:23:14 +03:00
parent 4d241131fc
commit d08b418d59

View file

@ -68,3 +68,25 @@ pub enum ParseMode {
HTML,
Markdown,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn html_serialization() {
let expected_json = String::from(r#""HTML""#);
let actual_json = serde_json::to_string(&ParseMode::HTML).unwrap();
assert_eq!(expected_json, actual_json)
}
#[test]
fn markdown_serialization() {
let expected_json = String::from(r#""Markdown""#);
let actual_json = serde_json::to_string(&ParseMode::Markdown).unwrap();
assert_eq!(expected_json, actual_json)
}
}