Skip to content

Commit

Permalink
🐛 Add some tests for across mods' call for auto! macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Nov 14, 2024
1 parent 8e1604b commit 73a33ee
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/auto_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,30 @@ mod test {
assert_eq!(auto!(Root2::A), Root2::A);
}
}

#[macro_use]
mod across_mod_1 {
use yuuka::derive_struct;

derive_struct!(Root {
a: {
b: String
}
});
}

mod across_mod_2 {
use yuuka::auto;

use super::across_mod_1::*;

#[test]
fn test() {
let val = auto!(Root {
a: {
b: "hello".to_string()
}
});
assert_eq!(val.a.b, "hello");
}
}

0 comments on commit 73a33ee

Please sign in to comment.