| 1 | extern crate handlebarsrust-analyzer cargo handlebars 5.1.2 handlebars/; |
| 2 | #[macro_use] |
| 3 | extern crate serde_jsonrust-analyzer cargo handlebars 5.1.2 serde_json/; |
| 4 | |
| 5 | use handlebarsrust-analyzer cargo handlebars 5.1.2 crate/::Handlebarsrust-analyzer cargo handlebars 5.1.2 registry/Registry#; |
| 6 | |
| 7 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 8 | fn test_walk_dir_template_namerust-analyzer cargo handlebars 5.1.2 test_walk_dir_template_name().() { |
| 9 | let mut hbs = Handlebarsrust-analyzer cargo handlebars 5.1.2 registry/Registry#::newrust-analyzer cargo handlebars 5.1.2 registry/impl#[`Registry<'reg>`]new().(); |
| 10 | |
| 11 | let data = jsonrust-analyzer cargo serde_json 1.0.114 macros/json!!({ |
| 12 | "a": [1, 2, 3, 4], |
| 13 | "b": "top" |
| 14 | }); |
| 15 | |
| 16 | hbs.register_template_stringrust-analyzer cargo handlebars 5.1.2 registry/impl#[`Registry<'reg>`]register_template_string().("foo/bar", "{{@root/b}}") |
| 17 | .unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 18 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(hbs.render_templaterust-analyzer cargo handlebars 5.1.2 registry/impl#[`Registry<'reg>`]render_template().("{{> foo/bar }}", &data).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), "top"); |
| 19 | } |
| 20 | |
| 21 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 22 | fn test_walk_dir_template_name_with_argsrust-analyzer cargo handlebars 5.1.2 test_walk_dir_template_name_with_args().() { |
| 23 | let mut hbs = Handlebarsrust-analyzer cargo handlebars 5.1.2 registry/Registry#::newrust-analyzer cargo handlebars 5.1.2 registry/impl#[`Registry<'reg>`]new().(); |
| 24 | |
| 25 | let data = jsonrust-analyzer cargo serde_json 1.0.114 macros/json!!({ |
| 26 | "a": [1, 2, 3, 4], |
| 27 | "b": "top" |
| 28 | }); |
| 29 | |
| 30 | hbs.register_template_stringrust-analyzer cargo handlebars 5.1.2 registry/impl#[`Registry<'reg>`]register_template_string().("foo/bar", "{{this}}").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 31 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 32 | hbs.render_templaterust-analyzer cargo handlebars 5.1.2 registry/impl#[`Registry<'reg>`]render_template().("{{> foo/bar b }}", &data).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), |
| 33 | "top" |
| 34 | ); |
| 35 | } |