Skip to content

Commit 11a07a5

Browse files
committed
chore: tuple and nested test
1 parent ce355aa commit 11a07a5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/macro.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,21 @@ pub struct MyCfg {
2222
pub maybe_not_needed: Option<String>,
2323
}
2424

25+
#[derive(Debug, FromEnv)]
26+
pub struct MyTupleCfg(
27+
#[from_env(var = "FIRST_ELEMENT", desc = "this is the first tuple element")] pub u8,
28+
pub MyCfg,
29+
);
30+
2531
#[test]
2632
fn basic_inventory() {
2733
let inv = MyCfg::inventory();
2834
assert_eq!(inv.len(), 4);
2935
}
36+
37+
#[test]
38+
fn nested_inventory() {
39+
let inv = MyTupleCfg::inventory();
40+
assert_eq!(inv.len(), 5);
41+
dbg!(inv);
42+
}

0 commit comments

Comments
 (0)