summaryrefslogtreecommitdiffstats
path: root/tests/424.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/424.rs')
-rw-r--r--tests/424.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/424.rs b/tests/424.rs
new file mode 100644
index 0000000..d0d42e7
--- /dev/null
+++ b/tests/424.rs
@@ -0,0 +1,28 @@
+use config::Config;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+enum EType {
+ E1,
+ E2(u64),
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct SType {
+ f1: EType,
+}
+
+impl SType {
+ pub fn new(path: &str) -> Self {
+ let config = Config::builder()
+ .add_source(config::File::with_name(path))
+ .build()
+ .unwrap();
+ config.try_deserialize::<SType>().unwrap()
+ }
+}
+
+#[test]
+fn test_424() {
+ println!("{:?}", SType::new("tests/424.yaml"));
+}