From b0efe070adb5958382d28f24cc0c4bdd6943d490 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 3 Jan 2024 03:00:50 +0100 Subject: [PATCH] Add parsing-related tests --- micronfig_macros/tests/sources/parse_single_i64.rs | 7 +++++++ micronfig_macros/tests/sources/parse_single_ipaddr.rs | 7 +++++++ .../tests/sources/parse_single_pathbuf_full.rs | 7 +++++++ .../tests/sources/parse_single_pathbuf_use.rs | 9 +++++++++ micronfig_macros/tests/sources/parse_single_u64.rs | 7 +++++++ micronfig_macros/tests/tests.rs | 5 +++++ 6 files changed, 42 insertions(+) create mode 100644 micronfig_macros/tests/sources/parse_single_i64.rs create mode 100644 micronfig_macros/tests/sources/parse_single_ipaddr.rs create mode 100644 micronfig_macros/tests/sources/parse_single_pathbuf_full.rs create mode 100644 micronfig_macros/tests/sources/parse_single_pathbuf_use.rs create mode 100644 micronfig_macros/tests/sources/parse_single_u64.rs diff --git a/micronfig_macros/tests/sources/parse_single_i64.rs b/micronfig_macros/tests/sources/parse_single_i64.rs new file mode 100644 index 0000000..bf424f3 --- /dev/null +++ b/micronfig_macros/tests/sources/parse_single_i64.rs @@ -0,0 +1,7 @@ +micronfig::config! { + GARASAUTO: String > i64, +} + +fn main() { + println!("{:?}", GARASAUTO()) +} diff --git a/micronfig_macros/tests/sources/parse_single_ipaddr.rs b/micronfig_macros/tests/sources/parse_single_ipaddr.rs new file mode 100644 index 0000000..300c8c8 --- /dev/null +++ b/micronfig_macros/tests/sources/parse_single_ipaddr.rs @@ -0,0 +1,7 @@ +micronfig::config! { + MY_IP_ADDR: String > IpAddr, +} + +fn main() { + println!("{:?}", MY_IP_ADDR()) +} diff --git a/micronfig_macros/tests/sources/parse_single_pathbuf_full.rs b/micronfig_macros/tests/sources/parse_single_pathbuf_full.rs new file mode 100644 index 0000000..50714da --- /dev/null +++ b/micronfig_macros/tests/sources/parse_single_pathbuf_full.rs @@ -0,0 +1,7 @@ +micronfig::config! { + GARASAUTO: String > std::path::PathBuf, +} + +fn main() { + println!("{:?}", GARASAUTO()) +} diff --git a/micronfig_macros/tests/sources/parse_single_pathbuf_use.rs b/micronfig_macros/tests/sources/parse_single_pathbuf_use.rs new file mode 100644 index 0000000..7363f89 --- /dev/null +++ b/micronfig_macros/tests/sources/parse_single_pathbuf_use.rs @@ -0,0 +1,9 @@ +use std::path::PathBuf; + +micronfig::config! { + GARASAUTO: String > PathBuf, +} + +fn main() { + println!("{:?}", GARASAUTO()) +} diff --git a/micronfig_macros/tests/sources/parse_single_u64.rs b/micronfig_macros/tests/sources/parse_single_u64.rs new file mode 100644 index 0000000..38aceb1 --- /dev/null +++ b/micronfig_macros/tests/sources/parse_single_u64.rs @@ -0,0 +1,7 @@ +micronfig::config! { + GARASAUTO: String > u64, +} + +fn main() { + println!("{:?}", GARASAUTO()) +} diff --git a/micronfig_macros/tests/tests.rs b/micronfig_macros/tests/tests.rs index 155fa36..d111ed9 100644 --- a/micronfig_macros/tests/tests.rs +++ b/micronfig_macros/tests/tests.rs @@ -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);