We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1887369 commit fdfb4f8Copy full SHA for fdfb4f8
tests/errors.rs
@@ -44,6 +44,28 @@ fn test_error_type() {
44
);
45
}
46
47
+#[test]
48
+fn test_error_deser_whole() {
49
+ #[derive(Deserialize, Debug)]
50
+ struct Place {
51
+ #[allow(dead_code)]
52
+ name: usize, // is actually s string
53
+ }
54
+
55
56
+ struct Output {
57
58
+ place: Place,
59
60
61
+ let c = make();
62
+ let err = c.try_deserialize::<Output>().unwrap_err().to_string();
63
+ assert_eq!(
64
+ err,
65
+ "invalid type: string \"Torre di Pisa\", expected an integer for key `place.name` in tests/Settings.toml",
66
+ );
67
+}
68
69
#[test]
70
fn test_error_type_detached() {
71
let c = make();
0 commit comments