We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1872db6 + f5f5295 commit 3b45e7fCopy full SHA for 3b45e7f
tests/integer_range.rs
@@ -0,0 +1,37 @@
1
+extern crate config;
2
+
3
+use config::*;
4
5
+#[test]
6
+fn wrapping_u16() {
7
+ let c = Config::builder()
8
+ .add_source(config::File::from_str(
9
+ r#"
10
+ [settings]
11
+ port = 66000
12
+ "#,
13
+ config::FileFormat::Toml,
14
+ ))
15
+ .build()
16
+ .unwrap();
17
18
+ let port: u16 = c.get("settings.port").unwrap();
19
+ assert_eq!(port, 464);
20
+}
21
22
23
+fn nonwrapping_u32() {
24
25
26
27
28
29
30
31
32
33
34
35
+ let port: u32 = c.get("settings.port").unwrap();
36
+ assert_eq!(port, 66000);
37
0 commit comments