Add `ParseMode` serialization tests
@@ -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)
+ }
+}
