-
Notifications
You must be signed in to change notification settings - Fork 1
/
basics_type_tuple_fields.rs
47 lines (39 loc) · 1.35 KB
/
basics_type_tuple_fields.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
macro_rules! initialize {
($relative_path:literal, $absolute_path:literal) => {
Asset($relative_path, include_str!($absolute_path))
};
}
#[iftree::include_file_tree(
"
paths = '/examples/assets/**'
template.initializer = 'initialize'
"
)]
pub struct Asset(&'static str, &'static str);
fn main() {
use base::examples::assets;
assert_eq!(assets::_ENV.0, "examples/assets/.env");
assert_eq!(assets::_ENV.1, "BASE=https://example.com\n");
assert_eq!(
assets::configuration::MENU_JSON.0,
"examples/assets/configuration/menu.json",
);
assert_eq!(assets::configuration::MENU_JSON.1, "\"Start\"\n");
assert_eq!(
assets::configuration::TRANSLATIONS_CSV.0,
"examples/assets/configuration/translations.csv",
);
assert_eq!(assets::configuration::TRANSLATIONS_CSV.1, "Hi {{name}}\n");
assert_eq!(assets::CREDITS_MD.0, "examples/assets/credits.md");
assert_eq!(assets::CREDITS_MD.1, "Boo Far\n");
assert_eq!(
assets::world::levels::TUTORIAL_JSON.0,
"examples/assets/world/levels/tutorial.json",
);
assert_eq!(assets::world::levels::TUTORIAL_JSON.1, "\"Welcome\"\n");
assert_eq!(
assets::world::PHYSICAL_CONSTANTS_JSON.0,
"examples/assets/world/physical_constants.json",
);
assert_eq!(assets::world::PHYSICAL_CONSTANTS_JSON.1, "7e-3\n");
}