From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/handlebars/tests/root_var.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 vendor/handlebars/tests/root_var.rs (limited to 'vendor/handlebars/tests/root_var.rs') diff --git a/vendor/handlebars/tests/root_var.rs b/vendor/handlebars/tests/root_var.rs new file mode 100644 index 000000000..fb310f6c1 --- /dev/null +++ b/vendor/handlebars/tests/root_var.rs @@ -0,0 +1,21 @@ +extern crate handlebars; +#[macro_use] +extern crate serde_json; + +use handlebars::Handlebars; + +#[test] +fn test_root_var() { + let hbs = Handlebars::new(); + + let data = json!({ + "a": [1, 2, 3, 4], + "b": "top" + }); + + assert_eq!( + hbs.render_template("{{#each a}}{{@root/b}}: {{this}};{{/each}}", &data) + .unwrap(), + "top: 1;top: 2;top: 3;top: 4;" + ); +} -- cgit v1.2.3