mirror of
https://github.com/Steffo99/micronfig.git
synced 2024-11-25 17:44:18 +00:00
Add parsing-related tests
This commit is contained in:
parent
ee70746f8c
commit
b0efe070ad
6 changed files with 42 additions and 0 deletions
7
micronfig_macros/tests/sources/parse_single_i64.rs
Normal file
7
micronfig_macros/tests/sources/parse_single_i64.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
micronfig::config! {
|
||||
GARASAUTO: String > i64,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", GARASAUTO())
|
||||
}
|
7
micronfig_macros/tests/sources/parse_single_ipaddr.rs
Normal file
7
micronfig_macros/tests/sources/parse_single_ipaddr.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
micronfig::config! {
|
||||
MY_IP_ADDR: String > IpAddr,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", MY_IP_ADDR())
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
micronfig::config! {
|
||||
GARASAUTO: String > std::path::PathBuf,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", GARASAUTO())
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
micronfig::config! {
|
||||
GARASAUTO: String > PathBuf,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", GARASAUTO())
|
||||
}
|
7
micronfig_macros/tests/sources/parse_single_u64.rs
Normal file
7
micronfig_macros/tests/sources/parse_single_u64.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
micronfig::config! {
|
||||
GARASAUTO: String > u64,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{:?}", GARASAUTO())
|
||||
}
|
|
@ -22,3 +22,8 @@ pass!(string_single_implicit);
|
|||
pass!(string_multi_explicit);
|
||||
pass!(string_multi_implicit);
|
||||
pass!(string_multi_mixed);
|
||||
pass!(parse_single_u64);
|
||||
pass!(parse_single_i64);
|
||||
pass!(parse_single_ipaddr);
|
||||
pass!(parse_single_pathbuf_full);
|
||||
pass!(parse_single_pathbuf_use);
|
||||
|
|
Loading…
Reference in a new issue