aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/serde.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/serde.rs b/tests/serde.rs
index bfbdc6f..0f4c37a 100644
--- a/tests/serde.rs
+++ b/tests/serde.rs
@@ -329,6 +329,25 @@ fn parse_enum() {
}
}
+#[test]
+fn parse_enum_string() {
+ #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
+ struct Foo { a: Sort }
+
+ #[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
+ #[serde(rename_all = "lowercase")]
+ enum Sort {
+ Asc,
+ Desc,
+ }
+
+ equivalent! {
+ Foo { a: Sort::Desc },
+ Table(map! { a: Value::String("desc".to_string()) }),
+ }
+
+}
+
// #[test]
// fn unused_fields() {
// #[derive(Serialize, Deserialize, PartialEq, Debug)]