use std::default::Default; use serialize::json::Json; use rumblebars::HBData; use rumblebars::EvalContext; macro_rules! equals_expected( ($res: expr, $expected: expr, $message: expr) => ( { match (& $res, & $expected) { ( res , exp ) => { if ! ((*res == *exp) && (*exp == *res)) { panic!("{}\nresult ==> {:?}\nexpected ==> {:?}", $message, res, exp) } } } } ) ); mod helpers { use std::io::Write; use rumblebars::HelperOptions; use rumblebars::HBData; use rumblebars::HBEvalResult; use rumblebars::EvalContext; use rumblebars::SafeWriting; pub fn test_helper(_: &[&HBData], _: &HelperOptions, out: &mut SafeWriting, _: &EvalContext) -> HBEvalResult { write!(out, "{}", "found it!") } pub fn world(_: &[&HBData], _: &HelperOptions, out: &mut SafeWriting, _: &EvalContext) -> HBEvalResult { write!(out, "{}", "world!") } } fn setup_test_specific_context(context: &mut EvalContext, data: &str) { match data { // needst test_helper "{\"template\":\"{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}\",\"data\":{\"cruel\":\"cruel\"},\"expected\":\"found it! Goodbye cruel world!!\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}" => { context.register_helper("test_helper".to_string(), Box::new(helpers::test_helper)); context.register_helper("world".to_string(), Box::new(helpers::world)); }, "{\"template\":\"Hello {{name}}. You have just won ${{value}}!{{#in_ca}} Well, ${{taxed_value}}, after taxes.{{/in_ca}}\",\"data\":{\"name\":\"Chris\",\"value\":10000,\"taxed_value\":6000,\"in_ca\":true},\"expected\":\"Hello Chris. You have just won $10000! Well, $6000, after taxes.\",\"message\":\"the hello world mustache example works\"}" => { context.compat = true; } _ => (), } } fn test_handlebars(data: &str) { let test_content = Json::from_str(data).unwrap(); let null = Json::Null; let template = test_content.find("template").unwrap_or(&null).as_string().unwrap_or("-- template missing --"); let ev_data = test_content.find("data").unwrap_or(&null); let partials = test_content.find("partials").unwrap_or(&null); let expected = test_content.find("expected").unwrap_or(&null).as_string().unwrap_or(" expectations missing "); let message = test_content.find("message").unwrap_or(&null).as_string().unwrap_or(" message n/a "); let options = test_content.find("options").unwrap_or(&null); let tmpl = ::rumblebars::parse(template).ok().unwrap(); let mut buf: Vec = Vec::new(); let mut eval_context: ::rumblebars::EvalContext = Default::default(); eval_context.compat = options.find("compat").unwrap_or(&null).as_bool(); setup_test_specific_context(&mut eval_context, data); match partials { &Json::Object(ref o) => { for (key, partial) in o.iter() { eval_context.register_partial(key.clone(), ::rumblebars::parse(partial.as_string().unwrap_or("")).ok().unwrap_or(Default::default())); } }, _ => (), } ::rumblebars::eval(&tmpl, ev_data, &mut buf, &eval_context).unwrap_or(()); equals_expected!(String::from_utf8(buf).unwrap(), expected, message); } // static list of handlebars tests known to fail static UNSUPPORTED_HANDLEBARS_FEATURES_CASES: [&'static str; 23] = [ // js version depends on custom lookup "{\"template\":\"{{foo}}\",\"data\":{\"bar_foo\":\"food\"},\"expected\":\"food\"}", // some escaping problem on test extraction "{\"template\":\"Awesome\\\\\",\"data\":{},\"expected\":\"Awesome\\\\\",\"message\":\"text is escaped so that the closing quote can't be ignored\"}", // goodbyes is a function in there "{\"template\":\"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!\",\"expected\":\"cruel !\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", // tests for unsupported (crazy) stuff "{\"template\":\"{{#each goodbyes}}{{@key}}. {{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":{\"2\":{\"text\":\"GOODBYE\"},\"#1\":{\"text\":\"goodbye\"}},\"world\":\"world\"}}", // unsupported (custom lookup ?) stuff "{\"template\":\"{{foo}} \",\"data\":{\"foo\":\"food\"},\"expected\":\"foo_food \"}", "{\"template\":\"{{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"food_foo\"}", // supposed to fail "{\"template\":\"{{> dude}}\",\"data\":{},\"partials\":{\"dude\":\"fail\"},\"expected\":\"\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", // includeZero? seriously ? "{\"template\":\"{{#if goodbye includeZero=true}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":0,\"world\":\"world\"},\"expected\":\"GOODBYE cruel world!\",\"message\":\"if with zero does not show the contents\"}", // no support for else if case, should be handle with inverse (^) and/or nested blocks "{\"template\":\"{{#people}}{{name}}{{else if none}}{{none}}{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}", "{\"template\":\"{{#people}}{{name}}{{else if nothere}}fail{{else unless nothere}}{{none}}{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}", "{\"template\":\"{{#people}}{{name}}{{else if none}}{{none}}{{else}}fail{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}", "{\"template\":\"{{#people}}\\n{{name}}\\n{{else if none}}\\n{{none}}\\n{{/people}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}", "{\"template\":\"{{#people}}\\n{{name}}\\n{{else if none}}\\n{{none}}\\n{{^}}\\n{{/people}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}", // partial is a function "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{},\"expected\":\"Dudes: Yehuda (http://yehuda) Alan (http://alan) \",\"message\":\"Function partials output based in VM.\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", // some weird autotrimming I don't understand "{\"template\":\"Dudes:\\n{{#dudes}}\\n {{>dude}}\\n{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}}\\n\"},\"expected\":\"Dudes:\\n Yehuda\\n Alan\\n\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", "{\"template\":\"Dudes:\\n{{#dudes}}\\n {{>dude}}\\n{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}}\\n {{> url}}\",\"url\":\"{{url}}!\\n\"},\"expected\":\"Dudes:\\n Yehuda\\n http://yehuda!\\n Alan\\n http://alan!\\n\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", "{\"template\":\"Dudes:\\n{{#dudes}}\\n {{>dude}}\\n{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}}\\n {{> url}}\",\"url\":\"{{url}}!\\n\"},\"expected\":\"Dudes:\\n Yehuda\\n http://yehuda!\\n Alan\\n http://alan!\\n\",\"options\":{\"preventIndent\":true,\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", // 0 as literal is falsy, but should be truthy on lookup? . I. don't. get. it. And it does not seam reasonable to me. "{\"template\":\"{{#foo}} This is {{bar}} ~ {{/foo}}\",\"data\":{\"foo\":0,\"bar\":\"OK\"},\"expected\":\" This is ~ \"}", // use [partial names] in theses cases (eg {{> shared/dude}} => {{> [shared/dude]}} "{\"template\":\"Dudes: {{> shared/dude}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"shared/dude\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", "{\"template\":\"Dudes: {{> shared/dude.thing}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"shared/dude.thing\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal with points in paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", "{\"template\":\"Dudes: {{> shared/dude}} {{> global_test}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"shared/dude\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers Creepers\",\"message\":\"Partials can use globals or passed\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", "{\"template\":\"Dudes: {{> shared/dude}} {{> global_test}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"expected\":\"Dudes: Jeepers Creepers\",\"message\":\"Partials can use globals or passed\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", "{\"template\":\"Dudes: {{> 404/asdf?.bar}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"404/asdf?.bar\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", // TODO : https://github.com/nicolas-cherel/rumblebars/issues/1 // "{\"template\":\"Dudes: {{#dudes}}{{> dude others=..}}{{/dudes}}\",\"data\":{\"foo\":\"bar\",\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{others.foo}}{{name}} ({{url}}) \"},\"expected\":\"Dudes: barYehuda (http://yehuda) barAlan (http://alan) \",\"message\":\"Basic partials output based on current context.\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}", ]; macro_rules! hbtest{ ($test_name: ident, $data: expr) => ( #[test] fn $test_name() { let may_fail = UNSUPPORTED_HANDLEBARS_FEATURES_CASES.contains(&$data); if ! may_fail { test_handlebars($data) } } ) } hbtest!(test_0_hb, "{\"template\":\"{{foo}}\",\"data\":{\"foo\":\"foo\"},\"expected\":\"foo\"}"); hbtest!(test_1_hb, "{\"template\":\"\\\\{{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"{{foo}}\"}"); hbtest!(test_2_hb, "{\"template\":\"content \\\\{{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"content {{foo}}\"}"); hbtest!(test_3_hb, "{\"template\":\"\\\\\\\\{{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"\\\\food\"}"); hbtest!(test_4_hb, "{\"template\":\"content \\\\\\\\{{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"content \\\\food\"}"); hbtest!(test_5_hb, "{\"template\":\"\\\\\\\\ {{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"\\\\\\\\ food\"}"); hbtest!(it_works_if_all_the_required_keys_are_provided6_hb, "{\"template\":\"Goodbye\\n{{cruel}}\\n{{world}}!\",\"data\":{\"cruel\":\"cruel\",\"world\":\"world\"},\"expected\":\"Goodbye\\ncruel\\nworld!\",\"message\":\"It works if all the required keys are provided\"}"); hbtest!(test_7_hb, "{\"template\":\"Goodbye\\n{{cruel}}\\n{{world.bar}}!\",\"expected\":\"Goodbye\\n\\n!\"}"); hbtest!(test_8_hb, "{\"template\":\"{{#unless foo}}Goodbye{{../test}}{{test2}}{{/unless}}\",\"expected\":\"Goodbye\"}"); hbtest!(comments_are_ignored9_hb, "{\"template\":\"{{! Goodbye}}Goodbye\\n{{cruel}}\\n{{world}}!\",\"data\":{\"cruel\":\"cruel\",\"world\":\"world\"},\"expected\":\"Goodbye\\ncruel\\nworld!\",\"message\":\"comments are ignored\"}"); hbtest!(test_10_hb, "{\"template\":\" {{~! comment ~}} blah\",\"data\":{},\"expected\":\"blah\"}"); hbtest!(test_11_hb, "{\"template\":\" {{~!-- long-comment --~}} blah\",\"data\":{},\"expected\":\"blah\"}"); hbtest!(test_12_hb, "{\"template\":\" {{! comment ~}} blah\",\"data\":{},\"expected\":\" blah\"}"); hbtest!(test_13_hb, "{\"template\":\" {{!-- long-comment --~}} blah\",\"data\":{},\"expected\":\" blah\"}"); hbtest!(test_14_hb, "{\"template\":\" {{~! comment}} blah\",\"data\":{},\"expected\":\" blah\"}"); hbtest!(test_15_hb, "{\"template\":\" {{~!-- long-comment --}} blah\",\"data\":{},\"expected\":\" blah\"}"); hbtest!(booleans_show_the_contents_when_true16_hb, "{\"template\":\"{{#goodbye}}GOODBYE {{/goodbye}}cruel {{world}}!\",\"data\":{\"goodbye\":true,\"world\":\"world\"},\"expected\":\"GOODBYE cruel world!\",\"message\":\"booleans show the contents when true\"}"); hbtest!(booleans_do_not_show_the_contents_when_false17_hb, "{\"template\":\"{{#goodbye}}GOODBYE {{/goodbye}}cruel {{world}}!\",\"data\":{\"goodbye\":false,\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"booleans do not show the contents when false\"}"); hbtest!(test_18_hb, "{\"template\":\"num1: {{num1}}, num2: {{num2}}\",\"data\":{\"num1\":42,\"num2\":0},\"expected\":\"num1: 42, num2: 0\"}"); hbtest!(test_19_hb, "{\"template\":\"num: {{.}}\",\"data\":0,\"expected\":\"num: 0\"}"); hbtest!(test_20_hb, "{\"template\":\"num: {{num1/num2}}\",\"data\":{\"num1\":{\"num2\":0}},\"expected\":\"num: 0\"}"); hbtest!(test_21_hb, "{\"template\":\"val1: {{val1}}, val2: {{val2}}\",\"data\":{\"val1\":false,\"val2\":false},\"expected\":\"val1: false, val2: false\"}"); hbtest!(test_22_hb, "{\"template\":\"val: {{.}}\",\"data\":false,\"expected\":\"val: false\"}"); hbtest!(test_23_hb, "{\"template\":\"val: {{val1/val2}}\",\"data\":{\"val1\":{\"val2\":false}},\"expected\":\"val: false\"}"); hbtest!(test_24_hb, "{\"template\":\"val1: {{{val1}}}, val2: {{{val2}}}\",\"data\":{\"val1\":false,\"val2\":false},\"expected\":\"val1: false, val2: false\"}"); hbtest!(test_25_hb, "{\"template\":\"val: {{{val1/val2}}}\",\"data\":{\"val1\":{\"val2\":false}},\"expected\":\"val: false\"}"); hbtest!(test_26_hb, "{\"template\":\"Alan's\\nTest\",\"data\":{},\"expected\":\"Alan's\\nTest\"}"); hbtest!(test_27_hb, "{\"template\":\"Alan's\\rTest\",\"data\":{},\"expected\":\"Alan's\\rTest\"}"); hbtest!(text_is_escaped_so_that_it_doesn_t_get_caught_on_single_quotes28_hb, "{\"template\":\"Awesome's\",\"data\":{},\"expected\":\"Awesome's\",\"message\":\"text is escaped so that it doesn't get caught on single quotes\"}"); hbtest!(text_is_escaped_so_that_the_closing_quote_can_t_be_ignored29_hb, "{\"template\":\"Awesome\\\\\",\"data\":{},\"expected\":\"Awesome\\\\\",\"message\":\"text is escaped so that the closing quote can't be ignored\"}"); hbtest!(text_is_escaped_so_that_it_doesn_t_mess_up_backslashes30_hb, "{\"template\":\"Awesome\\\\\\\\ foo\",\"data\":{},\"expected\":\"Awesome\\\\\\\\ foo\",\"message\":\"text is escaped so that it doesn't mess up backslashes\"}"); hbtest!(text_is_escaped_so_that_it_doesn_t_mess_up_backslashes31_hb, "{\"template\":\"Awesome {{foo}}\",\"data\":{\"foo\":\"\\\\\"},\"expected\":\"Awesome \\\\\",\"message\":\"text is escaped so that it doesn't mess up backslashes\"}"); hbtest!(double_quotes_never_produce_invalid_javascript32_hb, "{\"template\":\" \\\" \\\" \",\"data\":{},\"expected\":\" \\\" \\\" \",\"message\":\"double quotes never produce invalid javascript\"}"); hbtest!(expressions_with_handlebars_aren_t_escaped33_hb, "{\"template\":\"{{{awesome}}}\",\"data\":{\"awesome\":\"&\\\"\\\\<>\"},\"expected\":\"&\\\"\\\\<>\",\"message\":\"expressions with 3 handlebars aren't escaped\"}"); hbtest!(expressions_with_handlebars_aren_t_escaped34_hb, "{\"template\":\"{{&awesome}}\",\"data\":{\"awesome\":\"&\\\"\\\\<>\"},\"expected\":\"&\\\"\\\\<>\",\"message\":\"expressions with {{& handlebars aren't escaped\"}"); hbtest!(by_default_expressions_should_be_escaped35_hb, "{\"template\":\"{{awesome}}\",\"data\":{\"awesome\":\"&\\\"'`\\\\<>\"},\"expected\":\"&"'`\\\\<>\",\"message\":\"by default expressions should be escaped\"}"); hbtest!(escaping_should_properly_handle_amperstands36_hb, "{\"template\":\"{{awesome}}\",\"data\":{\"awesome\":\"Escaped, looks like: <b>\"},\"expected\":\"Escaped, <b> looks like: &lt;b&gt;\",\"message\":\"escaping should properly handle amperstands\"}"); hbtest!(paths_can_contain_hyphens_37_hb, "{\"template\":\"{{foo-bar}}\",\"data\":{\"foo-bar\":\"baz\"},\"expected\":\"baz\",\"message\":\"Paths can contain hyphens (-)\"}"); hbtest!(paths_can_contain_hyphens_38_hb, "{\"template\":\"{{foo.foo-bar}}\",\"data\":{\"foo\":{\"foo-bar\":\"baz\"}},\"expected\":\"baz\",\"message\":\"Paths can contain hyphens (-)\"}"); hbtest!(paths_can_contain_hyphens_39_hb, "{\"template\":\"{{foo/foo-bar}}\",\"data\":{\"foo\":{\"foo-bar\":\"baz\"}},\"expected\":\"baz\",\"message\":\"Paths can contain hyphens (-)\"}"); hbtest!(nested_paths_access_nested_objects40_hb, "{\"template\":\"Goodbye {{alan/expression}} world!\",\"data\":{\"alan\":{\"expression\":\"beautiful\"}},\"expected\":\"Goodbye beautiful world!\",\"message\":\"Nested paths access nested objects\"}"); hbtest!(nested_paths_access_nested_objects_with_empty_string41_hb, "{\"template\":\"Goodbye {{alan/expression}} world!\",\"data\":{\"alan\":{\"expression\":\"\"}},\"expected\":\"Goodbye world!\",\"message\":\"Nested paths access nested objects with empty string\"}"); hbtest!(literal_paths_can_be_used42_hb, "{\"template\":\"Goodbye {{[@alan]/expression}} world!\",\"data\":{\"@alan\":{\"expression\":\"beautiful\"}},\"expected\":\"Goodbye beautiful world!\",\"message\":\"Literal paths can be used\"}"); hbtest!(literal_paths_can_be_used43_hb, "{\"template\":\"Goodbye {{[foo bar]/expression}} world!\",\"data\":{\"foo bar\":{\"expression\":\"beautiful\"}},\"expected\":\"Goodbye beautiful world!\",\"message\":\"Literal paths can be used\"}"); hbtest!(literal_paths_can_be_used44_hb, "{\"template\":\"Goodbye {{[foo bar]}} world!\",\"data\":{\"foo bar\":\"beautiful\"},\"expected\":\"Goodbye beautiful world!\",\"message\":\"Literal paths can be used\"}"); hbtest!(test_45_hb, "{\"template\":\"{{person/name}}\",\"data\":{\"person\":{\"name\":null}},\"expected\":\"\"}"); hbtest!(test_46_hb, "{\"template\":\"{{person/name}}\",\"data\":{\"person\":{}},\"expected\":\"\"}"); hbtest!(this_keyword_in_paths_evaluates_to_current_context47_hb, "{\"template\":\"{{#goodbyes}}{{this}}{{/goodbyes}}\",\"data\":{\"goodbyes\":[\"goodbye\",\"Goodbye\",\"GOODBYE\"]},\"expected\":\"goodbyeGoodbyeGOODBYE\",\"message\":\"This keyword in paths evaluates to current context\"}"); hbtest!(this_keyword_evaluates_in_more_complex_paths48_hb, "{\"template\":\"{{#hellos}}{{this/text}}{{/hellos}}\",\"data\":{\"hellos\":[{\"text\":\"hello\"},{\"text\":\"Hello\"},{\"text\":\"HELLO\"}]},\"expected\":\"helloHelloHELLO\",\"message\":\"This keyword evaluates in more complex paths\"}"); hbtest!(arrays_iterate_over_the_contents_when_not_empty49_hb, "{\"template\":\"{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!\",\"data\":{\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}],\"world\":\"world\"},\"expected\":\"goodbye! Goodbye! GOODBYE! cruel world!\",\"message\":\"Arrays iterate over the contents when not empty\"}"); hbtest!(arrays_ignore_the_contents_when_empty50_hb, "{\"template\":\"{{#goodbyes}}{{text}}! {{/goodbyes}}cruel {{world}}!\",\"data\":{\"goodbyes\":[],\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"Arrays ignore the contents when empty\"}"); hbtest!(test_51_hb, "{\"template\":\"{{#goodbyes}}{{text}}{{/goodbyes}} {{#goodbyes}}{{text}}{{/goodbyes}}\",\"data\":{\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}],\"world\":\"world\"},\"expected\":\"goodbyeGoodbyeGOODBYE goodbyeGoodbyeGOODBYE\",\"options\":{\"data\":false,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(arrays_iterate_over_the_contents_when_not_empty52_hb, "{\"template\":\"{{#goodbyes}}{{/goodbyes}}cruel {{world}}!\",\"data\":{\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}],\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"Arrays iterate over the contents when not empty\"}"); hbtest!(arrays_ignore_the_contents_when_empty53_hb, "{\"template\":\"{{#goodbyes}}{{/goodbyes}}cruel {{world}}!\",\"data\":{\"goodbyes\":[],\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"Arrays ignore the contents when empty\"}"); hbtest!(templates_can_access_variables_in_contexts_up_the_stack_with_relative_path_syntax54_hb, "{\"template\":\"{{#goodbyes}}{{text}} cruel {{../name}}! {{/goodbyes}}\",\"data\":{\"name\":\"Alan\",\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}]},\"expected\":\"goodbye cruel Alan! Goodbye cruel Alan! GOODBYE cruel Alan! \",\"message\":\"Templates can access variables in contexts up the stack with relative path syntax\"}"); hbtest!(test_55_hb, "{\"template\":\"{{#goodbyes}}{{../name}}{{../name}}{{/goodbyes}}\",\"data\":{\"name\":\"Alan\",\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}]},\"expected\":\"AlanAlanAlanAlanAlanAlan\"}"); hbtest!(test_56_hb, "{\"template\":\"{{#outer}}Goodbye {{#inner}}cruel {{../sibling}} {{../../omg}}{{/inner}}{{/outer}}\",\"data\":{\"omg\":\"OMG!\",\"outer\":[{\"sibling\":\"sad\",\"inner\":[{\"text\":\"goodbye\"}]}]},\"expected\":\"Goodbye cruel sad OMG!\"}"); hbtest!(inverted_section_rendered_when_value_isn_t_set_57_hb, "{\"template\":\"{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}\",\"data\":{},\"expected\":\"Right On!\",\"message\":\"Inverted section rendered when value isn't set.\"}"); hbtest!(inverted_section_rendered_when_value_is_false_58_hb, "{\"template\":\"{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}\",\"data\":{\"goodbyes\":false},\"expected\":\"Right On!\",\"message\":\"Inverted section rendered when value is false.\"}"); hbtest!(inverted_section_rendered_when_value_is_empty_set_59_hb, "{\"template\":\"{{#goodbyes}}{{this}}{{/goodbyes}}{{^goodbyes}}Right On!{{/goodbyes}}\",\"data\":{\"goodbyes\":[]},\"expected\":\"Right On!\",\"message\":\"Inverted section rendered when value is empty set.\"}"); hbtest!(test_60_hb, "{\"template\":\"{{#people}}{{name}}{{^}}{{none}}{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}"); hbtest!(test_61_hb, "{\"template\":\"{{#people}}{{name}}{{else if none}}{{none}}{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}"); hbtest!(test_62_hb, "{\"template\":\"{{#people}}{{name}}{{else if nothere}}fail{{else unless nothere}}{{none}}{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}"); hbtest!(test_63_hb, "{\"template\":\"{{#people}}{{name}}{{else if none}}{{none}}{{else}}fail{{/people}}\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\"}"); hbtest!(test_64_hb, "{\"template\":\"{{#people}}{{name}}{{^}}{{none}}{{/people}}\",\"data\":{\"none\":\"No people\",\"people\":[]},\"expected\":\"No people\"}"); hbtest!(test_65_hb, "{\"template\":\"{{#people}}\\n{{name}}\\n{{^}}\\n{{none}}\\n{{/people}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}"); hbtest!(test_66_hb, "{\"template\":\"{{#none}}\\n{{.}}\\n{{^}}\\n{{none}}\\n{{/none}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}"); hbtest!(test_67_hb, "{\"template\":\"{{#people}}\\n{{name}}\\n{{^}}\\n{{none}}\\n{{/people}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}"); hbtest!(test_68_hb, "{\"template\":\"{{#people}}\\n{{name}}\\n{{else if none}}\\n{{none}}\\n{{/people}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}"); hbtest!(test_69_hb, "{\"template\":\"{{#people}}\\n{{name}}\\n{{else if none}}\\n{{none}}\\n{{^}}\\n{{/people}}\\n\",\"data\":{\"none\":\"No people\"},\"expected\":\"No people\\n\"}"); hbtest!(test_70_hb, "{\"template\":\"{{#data}}\\n{{#if true}}\\n{{.}}\\n{{/if}}\\n{{/data}}\\nOK.\",\"data\":{\"data\":[1,3,5]},\"expected\":\"1\\n3\\n5\\nOK.\"}"); hbtest!(test_71_hb, "{\"template\":\"{{#outer}}Goodbye {{#inner}}cruel {{omg}}{{/inner}}{{/outer}}\",\"data\":{\"omg\":\"OMG!\",\"outer\":[{\"inner\":[{\"text\":\"goodbye\"}]}]},\"expected\":\"Goodbye cruel OMG!\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_72_hb, "{\"template\":\"{{#outer}}Goodbye {{#inner}}cruel {{omg.yes}}{{/inner}}{{/outer}}\",\"data\":{\"omg\":{\"yes\":\"OMG!\"},\"outer\":[{\"inner\":[{\"yes\":\"no\",\"text\":\"goodbye\"}]}]},\"expected\":\"Goodbye cruel OMG!\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_73_hb, "{\"template\":\"{{#outer}}Goodbye {{#inner}}cruel {{omg.yes}}{{/inner}}{{/outer}}\",\"data\":{\"omg\":{\"no\":\"OMG!\"},\"outer\":[{\"inner\":[{\"yes\":\"no\",\"text\":\"goodbye\"}]}]},\"expected\":\"Goodbye cruel \",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(if_with_boolean_argument_shows_the_contents_when_true74_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":true,\"world\":\"world\"},\"expected\":\"GOODBYE cruel world!\",\"message\":\"if with boolean argument shows the contents when true\"}"); hbtest!(if_with_string_argument_shows_the_contents75_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":\"dummy\",\"world\":\"world\"},\"expected\":\"GOODBYE cruel world!\",\"message\":\"if with string argument shows the contents\"}"); hbtest!(if_with_boolean_argument_does_not_show_the_contents_when_false76_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":false,\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"if with boolean argument does not show the contents when false\"}"); hbtest!(if_with_undefined_does_not_show_the_contents77_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"if with undefined does not show the contents\"}"); hbtest!(if_with_non_empty_array_shows_the_contents78_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":[\"foo\"],\"world\":\"world\"},\"expected\":\"GOODBYE cruel world!\",\"message\":\"if with non-empty array shows the contents\"}"); hbtest!(if_with_empty_array_does_not_show_the_contents79_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":[],\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"if with empty array does not show the contents\"}"); hbtest!(if_with_zero_does_not_show_the_contents80_hb, "{\"template\":\"{{#if goodbye}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":0,\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"if with zero does not show the contents\"}"); hbtest!(if_with_zero_does_not_show_the_contents81_hb, "{\"template\":\"{{#if goodbye includeZero=true}}GOODBYE {{/if}}cruel {{world}}!\",\"data\":{\"goodbye\":0,\"world\":\"world\"},\"expected\":\"GOODBYE cruel world!\",\"message\":\"if with zero does not show the contents\"}"); hbtest!(test_82_hb, "{\"template\":\"{{#with person}}{{first}} {{last}}{{/with}}\",\"data\":{\"person\":{\"first\":\"Alan\",\"last\":\"Johnson\"}},\"expected\":\"Alan Johnson\"}"); hbtest!(test_83_hb, "{\"template\":\"{{#with person}}Person is present{{else}}Person is not present{{/with}}\",\"data\":{},\"expected\":\"Person is not present\"}"); hbtest!(each_with_array_argument_iterates_over_the_contents_when_not_empty84_hb, "{\"template\":\"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}],\"world\":\"world\"},\"expected\":\"goodbye! Goodbye! GOODBYE! cruel world!\",\"message\":\"each with array argument iterates over the contents when not empty\"}"); hbtest!(each_with_array_argument_ignores_the_contents_when_empty85_hb, "{\"template\":\"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":[],\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"each with array argument ignores the contents when empty\"}"); hbtest!(test_86_hb, "{\"template\":\"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":[{\"text\":\"goodbye\"},{\"text\":\"Goodbye\"},{\"text\":\"GOODBYE\"}],\"world\":\"world\"},\"expected\":\"goodbye! Goodbye! GOODBYE! cruel world!\",\"options\":{\"data\":false,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_87_hb, "{\"template\":\"{{#each .}}{{.}}{{/each}}\",\"data\":{\"goodbyes\":\"cruel\",\"world\":\"world\"},\"expected\":\"cruelworld\",\"options\":{\"data\":false,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_88_hb, "{\"template\":\"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!\",\"expected\":\"cruel !\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_89_hb, "{\"template\":\"{{#each goodbyes}}{{@key}}. {{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":{\"2\":{\"text\":\"GOODBYE\"},\"#1\":{\"text\":\"goodbye\"}},\"world\":\"world\"}}"); hbtest!(test_90_hb, "{\"template\":\"{{#each goodbyes}}{{@key}}. {{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":{},\"world\":\"world\"},\"expected\":\"cruel world!\"}"); hbtest!(each_with_array_function_argument_ignores_the_contents_when_empty91_hb, "{\"template\":\"{{#each goodbyes}}{{text}}! {{/each}}cruel {{world}}!\",\"data\":{\"goodbyes\":[],\"world\":\"world\"},\"expected\":\"cruel world!\",\"message\":\"each with array function argument ignores the contents when empty\"}"); hbtest!(log_should_not_display92_hb, "{\"template\":\"{{log blah}}\",\"data\":{\"blah\":\"whee\"},\"expected\":\"\",\"message\":\"log should not display\"}"); hbtest!(test_93_hb, "{\"template\":\"{{log blah}}\",\"data\":{\"blah\":\"whee\"},\"expected\":\"\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(log_should_not_display94_hb, "{\"template\":\"{{log blah}}\",\"data\":{\"blah\":\"whee\"},\"expected\":\"\",\"message\":\"log should not display\"}"); hbtest!(test_95_hb, "{\"template\":\"{{log blah}}\",\"data\":{\"blah\":\"whee\"},\"expected\":\"\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_96_hb, "{\"template\":\"{{log blah}}\",\"data\":{\"blah\":\"whee\"},\"expected\":\"\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_97_hb, "{\"template\":\"{{#empty}}shouldn't render{{/empty}}\",\"data\":{},\"expected\":\"\"}"); hbtest!(test_98_hb, "{\"template\":\"{{test_helper}} {{#if cruel}}Goodbye {{cruel}} {{world}}!{{/if}}\",\"data\":{\"cruel\":\"cruel\"},\"expected\":\"found it! Goodbye cruel world!!\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_99_hb, "{\"template\":\"{{foo}}\",\"data\":{\"bar_foo\":\"food\"},\"expected\":\"food\"}"); hbtest!(test_100_hb, "{\"template\":\"{{foo}} {{~null~}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"food\"}"); hbtest!(test_101_hb, "{\"template\":\"{{foo}} \",\"data\":{\"foo\":\"food\"},\"expected\":\"food \"}"); hbtest!(test_102_hb, "{\"template\":\"{{foo}} \",\"data\":{\"foo\":\"food\"},\"expected\":\"foo_food \"}"); hbtest!(test_103_hb, "{\"template\":\"{{foo}}\",\"data\":{\"foo\":\"food\"},\"expected\":\"food_foo\"}"); hbtest!(test_104_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}} ({{url}}) \"},\"expected\":\"Dudes: Yehuda (http://yehuda) Alan (http://alan) \",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_105_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}} ({{url}}) \"},\"expected\":\"Dudes: Yehuda (http://yehuda) Alan (http://alan) \",\"options\":{\"data\":false,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_be_passed_a_context106_hb, "{\"template\":\"Dudes: {{>dude dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{#this}}{{name}} ({{url}}) {{/this}}\"},\"expected\":\"Dudes: Yehuda (http://yehuda) Alan (http://alan) \",\"message\":\"Partials can be passed a context\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_107_hb, "{\"template\":\"Dudes: {{>dude dudes}}\",\"data\":{},\"partials\":{\"dude\":\"{{foo}} Empty\"},\"expected\":\"Dudes: Empty\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(basic_partials_output_based_on_current_context_108_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude others=..}}{{/dudes}}\",\"data\":{\"foo\":\"bar\",\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{others.foo}}{{name}} ({{url}}) \"},\"expected\":\"Dudes: barYehuda (http://yehuda) barAlan (http://alan) \",\"message\":\"Basic partials output based on current context.\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_are_rendered_inside_of_other_partials109_hb, "{\"template\":\"Dudes: {{#dudes}}{{>dude}}{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}} {{> url}} \",\"url\":\"{{url}}\"},\"expected\":\"Dudes: Yehuda http://yehuda Alan http://alan \",\"message\":\"Partials are rendered inside of other partials\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(function_partials_output_based_in_vm_110_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{},\"expected\":\"Dudes: Yehuda (http://yehuda) Alan (http://alan) \",\"message\":\"Function partials output based in VM.\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(regular_selectors_can_follow_a_partial111_hb, "{\"template\":\"Dudes: {{>dude}} {{another_dude}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"dude\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers Creepers\",\"message\":\"Regular selectors can follow a partial\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_literal_paths112_hb, "{\"template\":\"Dudes: {{> shared/dude}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"shared/dude\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_literal_with_points_in_paths113_hb, "{\"template\":\"Dudes: {{> shared/dude.thing}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"shared/dude.thing\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal with points in paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_globals_or_passed114_hb, "{\"template\":\"Dudes: {{> shared/dude}} {{> global_test}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"shared/dude\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers Creepers\",\"message\":\"Partials can use globals or passed\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_globals_or_passed115_hb, "{\"template\":\"Dudes: {{> shared/dude}} {{> global_test}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"expected\":\"Dudes: Jeepers Creepers\",\"message\":\"Partials can use globals or passed\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_literal_paths116_hb, "{\"template\":\"Dudes: {{> 404}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"404\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_literal_paths117_hb, "{\"template\":\"Dudes: {{> 404/asdf?.bar}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"404/asdf?.bar\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_literal_paths118_hb, "{\"template\":\"Dudes: {{> [+404/asdf?.bar]}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"+404/asdf?.bar\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(partials_can_use_literal_paths119_hb, "{\"template\":\"Dudes: {{> \\\"+404/asdf?.bar\\\"}}\",\"data\":{\"name\":\"Jeepers\",\"another_dude\":\"Creepers\"},\"partials\":{\"+404/asdf?.bar\":\"{{name}}\"},\"expected\":\"Dudes: Jeepers\",\"message\":\"Partials can use literal paths\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_120_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"\"},\"expected\":\"Dudes: \",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_121_hb, "{\"template\":\"{{> dude}}\",\"data\":{},\"partials\":{\"dude\":\"fail\"},\"expected\":\"\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_122_hb, "{\"template\":\"Dudes:\\n{{#dudes}}\\n {{>dude}}\\n{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}}\\n\"},\"expected\":\"Dudes:\\n Yehuda\\n Alan\\n\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_123_hb, "{\"template\":\"Dudes:\\n{{#dudes}}\\n {{>dude}}\\n{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}}\\n {{> url}}\",\"url\":\"{{url}}!\\n\"},\"expected\":\"Dudes:\\n Yehuda\\n http://yehuda!\\n Alan\\n http://alan!\\n\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_124_hb, "{\"template\":\"Dudes:\\n{{#dudes}}\\n {{>dude}}\\n{{/dudes}}\",\"data\":{\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}}\\n {{> url}}\",\"url\":\"{{url}}!\\n\"},\"expected\":\"Dudes:\\n Yehuda\\n http://yehuda!\\n Alan\\n http://alan!\\n\",\"options\":{\"preventIndent\":true,\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_125_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"root\":\"yes\",\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}} ({{url}}) {{root}} \"},\"expected\":\"Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes \",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_126_hb, "{\"template\":\"Dudes: {{#dudes}}{{> dude}}{{/dudes}}\",\"data\":{\"root\":\"yes\",\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{name}} ({{url}}) {{root}} \"},\"expected\":\"Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes \",\"options\":{\"compat\":true,\"data\":false,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_127_hb, "{\"template\":\"Dudes: {{> dude}}\",\"data\":{\"root\":\"yes\",\"dudes\":[{\"name\":\"Yehuda\",\"url\":\"http://yehuda\"},{\"name\":\"Alan\",\"url\":\"http://alan\"}]},\"partials\":{\"dude\":\"{{#dudes}}{{name}} ({{url}}) {{root}} {{/dudes}}\"},\"expected\":\"Dudes: Yehuda (http://yehuda) yes Alan (http://alan) yes \",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(renders_without_an_undefined_property_error128_hb, "{\"template\":\"{{#books}}{{title}}{{author.name}}{{/books}}\",\"data\":{\"books\":[{\"title\":\"The origin of species\",\"author\":{\"name\":\"Charles Darwin\"}},{\"title\":\"Lazarillo de Tormes\"}]},\"expected\":\"The origin of speciesCharles DarwinLazarillo de Tormes\",\"message\":\"Renders without an undefined property error\"}"); hbtest!(inverted_sections_run_when_property_isn_t_present_in_context129_hb, "{\"template\":\"{{^set}}not set{{/set}} :: {{#set}}set{{/set}}\",\"data\":{},\"expected\":\"not set :: \",\"message\":\"inverted sections run when property isn't present in context\"}"); hbtest!(inverted_sections_run_when_property_is_undefined130_hb, "{\"template\":\"{{^set}}not set{{/set}} :: {{#set}}set{{/set}}\",\"data\":{},\"expected\":\"not set :: \",\"message\":\"inverted sections run when property is undefined\"}"); hbtest!(inverted_sections_run_when_property_is_false131_hb, "{\"template\":\"{{^set}}not set{{/set}} :: {{#set}}set{{/set}}\",\"data\":{\"set\":false},\"expected\":\"not set :: \",\"message\":\"inverted sections run when property is false\"}"); hbtest!(inverted_sections_don_t_run_when_property_is_true132_hb, "{\"template\":\"{{^set}}not set{{/set}} :: {{#set}}set{{/set}}\",\"data\":{\"set\":true},\"expected\":\" :: set\",\"message\":\"inverted sections don't run when property is true\"}"); hbtest!(it_works_as_expected133_hb, "{\"template\":\"{{arr.[0]}}, {{arr.[1]}}\",\"data\":{\"arr\":[1,2]},\"expected\":\"1, 2\",\"message\":\"it works as expected\"}"); hbtest!(test_134_hb, "{\"template\":\"{{./foo}}\",\"data\":{\"foo\":\"bar\"},\"expected\":\"bar\"}"); hbtest!(test_135_hb, "{\"template\":\"
\",\"data\":{},\"expected\":\"
\"}"); hbtest!(test_136_hb, "{\"template\":\"{{foo}}\",\"data\":{\"foo\":\"bar\"},\"expected\":\"bar\"}"); hbtest!(it_works_as_expected137_hb, "{\"template\":\"{{arr}}\",\"data\":{\"arr\":[1,2]},\"expected\":\"1,2\",\"message\":\"it works as expected\"}"); hbtest!(the_hello_world_mustache_example_works138_hb, "{\"template\":\"Hello {{name}}. You have just won ${{value}}!{{#in_ca}} Well, ${{taxed_value}}, after taxes.{{/in_ca}}\",\"data\":{\"name\":\"Chris\",\"value\":10000,\"taxed_value\":6000,\"in_ca\":true},\"expected\":\"Hello Chris. You have just won $10000! Well, $6000, after taxes.\",\"message\":\"the hello world mustache example works\"}"); hbtest!(test_139_hb, "{\"template\":\"{{#foo}} This is {{bar}} ~ {{/foo}}\",\"data\":{\"foo\":0,\"bar\":\"OK\"},\"expected\":\" This is ~ \"}"); hbtest!(test_140_hb, "{\"template\":\"{{foo.bar}}\",\"data\":{\"foo\":0},\"expected\":\"\"}"); hbtest!(comment_blocks_should_be_removed_from_the_template_comment_block_141_hb, "{\"template\":\"12345{{! Comment Block! }}67890\",\"data\":{},\"partials\":{},\"expected\":\"1234567890\",\"message\":\"Comment blocks should be removed from the template. \\\"12345{{! Comment Block! }}67890\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(multiline_comments_should_be_permitted_this_is_a_multi_line_comment_142_hb, "{\"template\":\"12345{{!\\n This is a\\n multi-line comment...\\n}}67890\\n\",\"data\":{},\"partials\":{},\"expected\":\"1234567890\\n\",\"message\":\"Multiline comments should be permitted. \\\"12345{{!\\n This is a\\n multi-line comment...\\n}}67890\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(all_standalone_comment_lines_should_be_removed_begin_comment_block_end_143_hb, "{\"template\":\"Begin.\\n{{! Comment Block! }}\\nEnd.\\n\",\"data\":{},\"partials\":{},\"expected\":\"Begin.\\nEnd.\\n\",\"message\":\"All standalone comment lines should be removed. \\\"Begin.\\n{{! Comment Block! }}\\nEnd.\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(all_standalone_comment_lines_should_be_removed_begin_indented_comment_block_end_144_hb, "{\"template\":\"Begin.\\n {{! Indented Comment Block! }}\\nEnd.\\n\",\"data\":{},\"partials\":{},\"expected\":\"Begin.\\nEnd.\\n\",\"message\":\"All standalone comment lines should be removed. \\\"Begin.\\n {{! Indented Comment Block! }}\\nEnd.\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(_r_n_should_be_considered_a_newline_for_standalone_tags_standalone_comment_145_hb, "{\"template\":\"|\\r\\n{{! Standalone Comment }}\\r\\n|\",\"data\":{},\"partials\":{},\"expected\":\"|\\r\\n|\",\"message\":\"\\\"\\\\r\\\\n\\\" should be considered a newline for standalone tags. \\\"|\\r\\n{{! Standalone Comment }}\\r\\n|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_precede_them_i_m_still_standalone_146_hb, "{\"template\":\" {{! I'm Still Standalone }}\\n!\",\"data\":{},\"partials\":{},\"expected\":\"!\",\"message\":\"Standalone tags should not require a newline to precede them. \\\" {{! I'm Still Standalone }}\\n!\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_follow_them_i_m_still_standalone_147_hb, "{\"template\":\"!\\n {{! I'm Still Standalone }}\",\"data\":{},\"partials\":{},\"expected\":\"!\\n\",\"message\":\"Standalone tags should not require a newline to follow them. \\\"!\\n {{! I'm Still Standalone }}\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(all_standalone_comment_lines_should_be_removed_begin_something_s_going_on_here_end_148_hb, "{\"template\":\"Begin.\\n{{!\\nSomething's going on here...\\n}}\\nEnd.\\n\",\"data\":{},\"partials\":{},\"expected\":\"Begin.\\nEnd.\\n\",\"message\":\"All standalone comment lines should be removed. \\\"Begin.\\n{{!\\nSomething's going on here...\\n}}\\nEnd.\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(all_standalone_comment_lines_should_be_removed_begin_something_s_going_on_here_end_149_hb, "{\"template\":\"Begin.\\n {{!\\n Something's going on here...\\n }}\\nEnd.\\n\",\"data\":{},\"partials\":{},\"expected\":\"Begin.\\nEnd.\\n\",\"message\":\"All standalone comment lines should be removed. \\\"Begin.\\n {{!\\n Something's going on here...\\n }}\\nEnd.\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(inline_comments_should_not_strip_whitespace_150_hb, "{\"template\":\" 12 {{! 34 }}\\n\",\"data\":{},\"partials\":{},\"expected\":\" 12 \\n\",\"message\":\"Inline comments should not strip whitespace \\\" 12 {{! 34 }}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(comment_removal_should_preserve_surrounding_whitespace_comment_block_151_hb, "{\"template\":\"12345 {{! Comment Block! }} 67890\",\"data\":{},\"partials\":{},\"expected\":\"12345 67890\",\"message\":\"Comment removal should preserve surrounding whitespace. \\\"12345 {{! Comment Block! }} 67890\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(mustache_free_templates_should_render_as_is_hello_from_mustache_152_hb, "{\"template\":\"Hello from {Mustache}!\\n\",\"data\":{},\"partials\":{},\"expected\":\"Hello from {Mustache}!\\n\",\"message\":\"Mustache-free templates should render as-is. \\\"Hello from {Mustache}!\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(unadorned_tags_should_interpolate_content_into_the_template_hello_subject_153_hb, "{\"template\":\"Hello, {{subject}}!\\n\",\"data\":{\"subject\":\"world\"},\"partials\":{},\"expected\":\"Hello, world!\\n\",\"message\":\"Unadorned tags should interpolate content into the template. \\\"Hello, {{subject}}!\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(basic_interpolation_should_be_html_escaped_these_characters_should_be_html_escaped_forbidden_154_hb, "{\"template\":\"These characters should be HTML escaped: {{forbidden}}\\n\",\"data\":{\"forbidden\":\"& \\\" < >\"},\"partials\":{},\"expected\":\"These characters should be HTML escaped: & " < >\\n\",\"message\":\"Basic interpolation should be HTML escaped. \\\"These characters should be HTML escaped: {{forbidden}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(triple_mustaches_should_interpolate_without_html_escaping_these_characters_should_not_be_html_escaped_forbidden_155_hb, "{\"template\":\"These characters should not be HTML escaped: {{{forbidden}}}\\n\",\"data\":{\"forbidden\":\"& \\\" < >\"},\"partials\":{},\"expected\":\"These characters should not be HTML escaped: & \\\" < >\\n\",\"message\":\"Triple mustaches should interpolate without HTML escaping. \\\"These characters should not be HTML escaped: {{{forbidden}}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(ampersand_should_interpolate_without_html_escaping_these_characters_should_not_be_html_escaped_forbidden_156_hb, "{\"template\":\"These characters should not be HTML escaped: {{&forbidden}}\\n\",\"data\":{\"forbidden\":\"& \\\" < >\"},\"partials\":{},\"expected\":\"These characters should not be HTML escaped: & \\\" < >\\n\",\"message\":\"Ampersand should interpolate without HTML escaping. \\\"These characters should not be HTML escaped: {{&forbidden}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(integers_should_interpolate_seamlessly_mph_miles_an_hour_157_hb, "{\"template\":\"\\\"{{mph}} miles an hour!\\\"\",\"data\":{\"mph\":85},\"partials\":{},\"expected\":\"\\\"85 miles an hour!\\\"\",\"message\":\"Integers should interpolate seamlessly. \\\"\\\"{{mph}} miles an hour!\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(integers_should_interpolate_seamlessly_mph_miles_an_hour_158_hb, "{\"template\":\"\\\"{{{mph}}} miles an hour!\\\"\",\"data\":{\"mph\":85},\"partials\":{},\"expected\":\"\\\"85 miles an hour!\\\"\",\"message\":\"Integers should interpolate seamlessly. \\\"\\\"{{{mph}}} miles an hour!\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(integers_should_interpolate_seamlessly_mph_miles_an_hour_159_hb, "{\"template\":\"\\\"{{&mph}} miles an hour!\\\"\",\"data\":{\"mph\":85},\"partials\":{},\"expected\":\"\\\"85 miles an hour!\\\"\",\"message\":\"Integers should interpolate seamlessly. \\\"\\\"{{&mph}} miles an hour!\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(decimals_should_interpolate_seamlessly_with_proper_significance_power_jiggawatts_160_hb, "{\"template\":\"\\\"{{power}} jiggawatts!\\\"\",\"data\":{\"power\":1.21},\"partials\":{},\"expected\":\"\\\"1.21 jiggawatts!\\\"\",\"message\":\"Decimals should interpolate seamlessly with proper significance. \\\"\\\"{{power}} jiggawatts!\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(decimals_should_interpolate_seamlessly_with_proper_significance_power_jiggawatts_161_hb, "{\"template\":\"\\\"{{{power}}} jiggawatts!\\\"\",\"data\":{\"power\":1.21},\"partials\":{},\"expected\":\"\\\"1.21 jiggawatts!\\\"\",\"message\":\"Decimals should interpolate seamlessly with proper significance. \\\"\\\"{{{power}}} jiggawatts!\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(decimals_should_interpolate_seamlessly_with_proper_significance_power_jiggawatts_162_hb, "{\"template\":\"\\\"{{&power}} jiggawatts!\\\"\",\"data\":{\"power\":1.21},\"partials\":{},\"expected\":\"\\\"1.21 jiggawatts!\\\"\",\"message\":\"Decimals should interpolate seamlessly with proper significance. \\\"\\\"{{&power}} jiggawatts!\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(failed_context_lookups_should_default_to_empty_strings_i_cannot_be_seen_163_hb, "{\"template\":\"I ({{cannot}}) be seen!\",\"data\":{},\"partials\":{},\"expected\":\"I () be seen!\",\"message\":\"Failed context lookups should default to empty strings. \\\"I ({{cannot}}) be seen!\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(failed_context_lookups_should_default_to_empty_strings_i_cannot_be_seen_164_hb, "{\"template\":\"I ({{{cannot}}}) be seen!\",\"data\":{},\"partials\":{},\"expected\":\"I () be seen!\",\"message\":\"Failed context lookups should default to empty strings. \\\"I ({{{cannot}}}) be seen!\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(failed_context_lookups_should_default_to_empty_strings_i_cannot_be_seen_165_hb, "{\"template\":\"I ({{&cannot}}) be seen!\",\"data\":{},\"partials\":{},\"expected\":\"I () be seen!\",\"message\":\"Failed context lookups should default to empty strings. \\\"I ({{&cannot}}) be seen!\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_considered_a_form_of_shorthand_for_sections_person_name_person_name_person_166_hb, "{\"template\":\"\\\"{{person.name}}\\\" == \\\"{{#person}}{{name}}{{/person}}\\\"\",\"data\":{\"person\":{\"name\":\"Joe\"}},\"partials\":{},\"expected\":\"\\\"Joe\\\" == \\\"Joe\\\"\",\"message\":\"Dotted names should be considered a form of shorthand for sections. \\\"\\\"{{person.name}}\\\" == \\\"{{#person}}{{name}}{{/person}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_considered_a_form_of_shorthand_for_sections_person_name_person_name_person_167_hb, "{\"template\":\"\\\"{{{person.name}}}\\\" == \\\"{{#person}}{{{name}}}{{/person}}\\\"\",\"data\":{\"person\":{\"name\":\"Joe\"}},\"partials\":{},\"expected\":\"\\\"Joe\\\" == \\\"Joe\\\"\",\"message\":\"Dotted names should be considered a form of shorthand for sections. \\\"\\\"{{{person.name}}}\\\" == \\\"{{#person}}{{{name}}}{{/person}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_considered_a_form_of_shorthand_for_sections_person_name_person_name_person_168_hb, "{\"template\":\"\\\"{{&person.name}}\\\" == \\\"{{#person}}{{&name}}{{/person}}\\\"\",\"data\":{\"person\":{\"name\":\"Joe\"}},\"partials\":{},\"expected\":\"\\\"Joe\\\" == \\\"Joe\\\"\",\"message\":\"Dotted names should be considered a form of shorthand for sections. \\\"\\\"{{&person.name}}\\\" == \\\"{{#person}}{{&name}}{{/person}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_functional_to_any_level_of_nesting_a_b_c_d_e_name_phil_169_hb, "{\"template\":\"\\\"{{a.b.c.d.e.name}}\\\" == \\\"Phil\\\"\",\"data\":{\"a\":{\"b\":{\"c\":{\"d\":{\"e\":{\"name\":\"Phil\"}}}}}},\"partials\":{},\"expected\":\"\\\"Phil\\\" == \\\"Phil\\\"\",\"message\":\"Dotted names should be functional to any level of nesting. \\\"\\\"{{a.b.c.d.e.name}}\\\" == \\\"Phil\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(any_falsey_value_prior_to_the_last_part_of_the_name_should_yield_a_b_c_170_hb, "{\"template\":\"\\\"{{a.b.c}}\\\" == \\\"\\\"\",\"data\":{\"a\":{}},\"partials\":{},\"expected\":\"\\\"\\\" == \\\"\\\"\",\"message\":\"Any falsey value prior to the last part of the name should yield ''. \\\"\\\"{{a.b.c}}\\\" == \\\"\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(each_part_of_a_dotted_name_should_resolve_only_against_its_parent_a_b_c_name_171_hb, "{\"template\":\"\\\"{{a.b.c.name}}\\\" == \\\"\\\"\",\"data\":{\"a\":{\"b\":{}},\"c\":{\"name\":\"Jim\"}},\"partials\":{},\"expected\":\"\\\"\\\" == \\\"\\\"\",\"message\":\"Each part of a dotted name should resolve only against its parent. \\\"\\\"{{a.b.c.name}}\\\" == \\\"\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(the_first_part_of_a_dotted_name_should_resolve_as_any_other_name_a_b_c_d_e_name_a_phil_172_hb, "{\"template\":\"\\\"{{#a}}{{b.c.d.e.name}}{{/a}}\\\" == \\\"Phil\\\"\",\"data\":{\"a\":{\"b\":{\"c\":{\"d\":{\"e\":{\"name\":\"Phil\"}}}}},\"b\":{\"c\":{\"d\":{\"e\":{\"name\":\"Wrong\"}}}}},\"partials\":{},\"expected\":\"\\\"Phil\\\" == \\\"Phil\\\"\",\"message\":\"The first part of a dotted name should resolve as any other name. \\\"\\\"{{#a}}{{b.c.d.e.name}}{{/a}}\\\" == \\\"Phil\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(interpolation_should_not_alter_surrounding_whitespace_string_173_hb, "{\"template\":\"| {{string}} |\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\"| --- |\",\"message\":\"Interpolation should not alter surrounding whitespace. \\\"| {{string}} |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(interpolation_should_not_alter_surrounding_whitespace_string_174_hb, "{\"template\":\"| {{{string}}} |\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\"| --- |\",\"message\":\"Interpolation should not alter surrounding whitespace. \\\"| {{{string}}} |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(interpolation_should_not_alter_surrounding_whitespace_string_175_hb, "{\"template\":\"| {{&string}} |\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\"| --- |\",\"message\":\"Interpolation should not alter surrounding whitespace. \\\"| {{&string}} |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_interpolation_should_not_alter_surrounding_whitespace_string_176_hb, "{\"template\":\" {{string}}\\n\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\" ---\\n\",\"message\":\"Standalone interpolation should not alter surrounding whitespace. \\\" {{string}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_interpolation_should_not_alter_surrounding_whitespace_string_177_hb, "{\"template\":\" {{{string}}}\\n\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\" ---\\n\",\"message\":\"Standalone interpolation should not alter surrounding whitespace. \\\" {{{string}}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_interpolation_should_not_alter_surrounding_whitespace_string_178_hb, "{\"template\":\" {{&string}}\\n\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\" ---\\n\",\"message\":\"Standalone interpolation should not alter surrounding whitespace. \\\" {{&string}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(superfluous_in_tag_whitespace_should_be_ignored_string_179_hb, "{\"template\":\"|{{ string }}|\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\"|---|\",\"message\":\"Superfluous in-tag whitespace should be ignored. \\\"|{{ string }}|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(superfluous_in_tag_whitespace_should_be_ignored_string_180_hb, "{\"template\":\"|{{{ string }}}|\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\"|---|\",\"message\":\"Superfluous in-tag whitespace should be ignored. \\\"|{{{ string }}}|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(superfluous_in_tag_whitespace_should_be_ignored_string_181_hb, "{\"template\":\"|{{& string }}|\",\"data\":{\"string\":\"---\"},\"partials\":{},\"expected\":\"|---|\",\"message\":\"Superfluous in-tag whitespace should be ignored. \\\"|{{& string }}|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(falsey_sections_should_have_their_contents_rendered_boolean_this_should_be_rendered_boolean_182_hb, "{\"template\":\"\\\"{{^boolean}}This should be rendered.{{/boolean}}\\\"\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"\\\"This should be rendered.\\\"\",\"message\":\"Falsey sections should have their contents rendered. \\\"\\\"{{^boolean}}This should be rendered.{{/boolean}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(truthy_sections_should_have_their_contents_omitted_boolean_this_should_not_be_rendered_boolean_183_hb, "{\"template\":\"\\\"{{^boolean}}This should not be rendered.{{/boolean}}\\\"\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"\\\"\\\"\",\"message\":\"Truthy sections should have their contents omitted. \\\"\\\"{{^boolean}}This should not be rendered.{{/boolean}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(objects_and_hashes_should_behave_like_truthy_values_context_hi_name_context_184_hb, "{\"template\":\"\\\"{{^context}}Hi {{name}}.{{/context}}\\\"\",\"data\":{\"context\":{\"name\":\"Joe\"}},\"partials\":{},\"expected\":\"\\\"\\\"\",\"message\":\"Objects and hashes should behave like truthy values. \\\"\\\"{{^context}}Hi {{name}}.{{/context}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(lists_should_behave_like_truthy_values_list_n_list_185_hb, "{\"template\":\"\\\"{{^list}}{{n}}{{/list}}\\\"\",\"data\":{\"list\":[{\"n\":1},{\"n\":2},{\"n\":3}]},\"partials\":{},\"expected\":\"\\\"\\\"\",\"message\":\"Lists should behave like truthy values. \\\"\\\"{{^list}}{{n}}{{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(empty_lists_should_behave_like_falsey_values_list_yay_lists_list_186_hb, "{\"template\":\"\\\"{{^list}}Yay lists!{{/list}}\\\"\",\"data\":{\"list\":[]},\"partials\":{},\"expected\":\"\\\"Yay lists!\\\"\",\"message\":\"Empty lists should behave like falsey values. \\\"\\\"{{^list}}Yay lists!{{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(multiple_inverted_sections_per_template_should_be_permitted_bool_first_bool_two_bool_third_bool_187_hb, "{\"template\":\"{{^bool}}\\n* first\\n{{/bool}}\\n* {{two}}\\n{{^bool}}\\n* third\\n{{/bool}}\\n\",\"data\":{\"two\":\"second\",\"bool\":false},\"partials\":{},\"expected\":\"* first\\n* second\\n* third\\n\",\"message\":\"Multiple inverted sections per template should be permitted. \\\"{{^bool}}\\n* first\\n{{/bool}}\\n* {{two}}\\n{{^bool}}\\n* third\\n{{/bool}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(nested_falsey_sections_should_have_their_contents_rendered_a_bool_b_bool_c_bool_d_bool_e_188_hb, "{\"template\":\"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |\",\"data\":{\"bool\":false},\"partials\":{},\"expected\":\"| A B C D E |\",\"message\":\"Nested falsey sections should have their contents rendered. \\\"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(nested_truthy_sections_should_be_omitted_a_bool_b_bool_c_bool_d_bool_e_189_hb, "{\"template\":\"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |\",\"data\":{\"bool\":true},\"partials\":{},\"expected\":\"| A E |\",\"message\":\"Nested truthy sections should be omitted. \\\"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(failed_context_lookups_should_be_considered_falsey_missing_cannot_find_key_missing_missing_190_hb, "{\"template\":\"[{{^missing}}Cannot find key 'missing'!{{/missing}}]\",\"data\":{},\"partials\":{},\"expected\":\"[Cannot find key 'missing'!]\",\"message\":\"Failed context lookups should be considered falsey. \\\"[{{^missing}}Cannot find key 'missing'!{{/missing}}]\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_valid_for_inverted_section_tags_a_b_c_not_here_a_b_c_191_hb, "{\"template\":\"\\\"{{^a.b.c}}Not Here{{/a.b.c}}\\\" == \\\"\\\"\",\"data\":{\"a\":{\"b\":{\"c\":true}}},\"partials\":{},\"expected\":\"\\\"\\\" == \\\"\\\"\",\"message\":\"Dotted names should be valid for Inverted Section tags. \\\"\\\"{{^a.b.c}}Not Here{{/a.b.c}}\\\" == \\\"\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_valid_for_inverted_section_tags_a_b_c_not_here_a_b_c_not_here_192_hb, "{\"template\":\"\\\"{{^a.b.c}}Not Here{{/a.b.c}}\\\" == \\\"Not Here\\\"\",\"data\":{\"a\":{\"b\":{\"c\":false}}},\"partials\":{},\"expected\":\"\\\"Not Here\\\" == \\\"Not Here\\\"\",\"message\":\"Dotted names should be valid for Inverted Section tags. \\\"\\\"{{^a.b.c}}Not Here{{/a.b.c}}\\\" == \\\"Not Here\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_that_cannot_be_resolved_should_be_considered_falsey_a_b_c_not_here_a_b_c_not_here_193_hb, "{\"template\":\"\\\"{{^a.b.c}}Not Here{{/a.b.c}}\\\" == \\\"Not Here\\\"\",\"data\":{\"a\":{}},\"partials\":{},\"expected\":\"\\\"Not Here\\\" == \\\"Not Here\\\"\",\"message\":\"Dotted names that cannot be resolved should be considered falsey. \\\"\\\"{{^a.b.c}}Not Here{{/a.b.c}}\\\" == \\\"Not Here\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(inverted_sections_should_not_alter_surrounding_whitespace_boolean_boolean_194_hb, "{\"template\":\" | {{^boolean}}\\t|\\t{{/boolean}} | \\n\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\" | \\t|\\t | \\n\",\"message\":\"Inverted sections should not alter surrounding whitespace. \\\" | {{^boolean}}\\t|\\t{{/boolean}} | \\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(inverted_should_not_alter_internal_whitespace_boolean_important_whitespace_boolean_195_hb, "{\"template\":\" | {{^boolean}} {{! Important Whitespace }}\\n {{/boolean}} | \\n\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\" | \\n | \\n\",\"message\":\"Inverted should not alter internal whitespace. \\\" | {{^boolean}} {{! Important Whitespace }}\\n {{/boolean}} | \\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(single_line_sections_should_not_alter_surrounding_whitespace_boolean_no_boolean_boolean_way_boolean_196_hb, "{\"template\":\" {{^boolean}}NO{{/boolean}}\\n {{^boolean}}WAY{{/boolean}}\\n\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\" NO\\n WAY\\n\",\"message\":\"Single-line sections should not alter surrounding whitespace. \\\" {{^boolean}}NO{{/boolean}}\\n {{^boolean}}WAY{{/boolean}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_lines_should_be_removed_from_the_template_this_is_boolean_boolean_a_line_197_hb, "{\"template\":\"| This Is\\n{{^boolean}}\\n|\\n{{/boolean}}\\n| A Line\\n\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"| This Is\\n|\\n| A Line\\n\",\"message\":\"Standalone lines should be removed from the template. \\\"| This Is\\n{{^boolean}}\\n|\\n{{/boolean}}\\n| A Line\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_indented_lines_should_be_removed_from_the_template_this_is_boolean_boolean_a_line_198_hb, "{\"template\":\"| This Is\\n {{^boolean}}\\n|\\n {{/boolean}}\\n| A Line\\n\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"| This Is\\n|\\n| A Line\\n\",\"message\":\"Standalone indented lines should be removed from the template. \\\"| This Is\\n {{^boolean}}\\n|\\n {{/boolean}}\\n| A Line\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(_r_n_should_be_considered_a_newline_for_standalone_tags_boolean_boolean_199_hb, "{\"template\":\"|\\r\\n{{^boolean}}\\r\\n{{/boolean}}\\r\\n|\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"|\\r\\n|\",\"message\":\"\\\"\\\\r\\\\n\\\" should be considered a newline for standalone tags. \\\"|\\r\\n{{^boolean}}\\r\\n{{/boolean}}\\r\\n|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_precede_them_boolean_boolean_200_hb, "{\"template\":\" {{^boolean}}\\n^{{/boolean}}\\n/\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"^\\n/\",\"message\":\"Standalone tags should not require a newline to precede them. \\\" {{^boolean}}\\n^{{/boolean}}\\n/\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_follow_them_boolean_boolean_201_hb, "{\"template\":\"^{{^boolean}}\\n/\\n {{/boolean}}\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"^\\n/\\n\",\"message\":\"Standalone tags should not require a newline to follow them. \\\"^{{^boolean}}\\n/\\n {{/boolean}}\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(superfluous_in_tag_whitespace_should_be_ignored_boolean_boolean_202_hb, "{\"template\":\"|{{^ boolean }}={{/ boolean }}|\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"|=|\",\"message\":\"Superfluous in-tag whitespace should be ignored. \\\"|{{^ boolean }}={{/ boolean }}|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(the_greater_than_operator_should_expand_to_the_named_partial_text_203_hb, "{\"template\":\"\\\"{{>text}}\\\"\",\"data\":{},\"partials\":{\"text\":\"from partial\"},\"expected\":\"\\\"from partial\\\"\",\"message\":\"The greater-than operator should expand to the named partial. \\\"\\\"{{>text}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(the_greater_than_operator_should_operate_within_the_current_context_partial_204_hb, "{\"template\":\"\\\"{{>partial}}\\\"\",\"data\":{\"text\":\"content\"},\"partials\":{\"partial\":\"*{{text}}*\"},\"expected\":\"\\\"*content*\\\"\",\"message\":\"The greater-than operator should operate within the current context. \\\"\\\"{{>partial}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(the_greater_than_operator_should_properly_recurse_node_205_hb, "{\"template\":\"{{>node}}\",\"data\":{\"content\":\"X\",\"nodes\":[{\"content\":\"Y\",\"nodes\":[]}]},\"partials\":{\"node\":\"{{content}}<{{#nodes}}{{>node}}{{/nodes}}>\"},\"expected\":\"X>\",\"message\":\"The greater-than operator should properly recurse. \\\"{{>node}}\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(the_greater_than_operator_should_not_alter_surrounding_whitespace_partial_206_hb, "{\"template\":\"| {{>partial}} |\",\"data\":{},\"partials\":{\"partial\":\"\\t|\\t\"},\"expected\":\"| \\t|\\t |\",\"message\":\"The greater-than operator should not alter surrounding whitespace. \\\"| {{>partial}} |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(whitespace_should_be_left_untouched_data_partial_207_hb, "{\"template\":\" {{data}} {{> partial}}\\n\",\"data\":{\"data\":\"|\"},\"partials\":{\"partial\":\">\\n>\"},\"expected\":\" | >\\n>\\n\",\"message\":\"Whitespace should be left untouched. \\\" {{data}} {{> partial}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(_r_n_should_be_considered_a_newline_for_standalone_tags_partial_208_hb, "{\"template\":\"|\\r\\n{{>partial}}\\r\\n|\",\"data\":{},\"partials\":{\"partial\":\">\"},\"expected\":\"|\\r\\n>|\",\"message\":\"\\\"\\\\r\\\\n\\\" should be considered a newline for standalone tags. \\\"|\\r\\n{{>partial}}\\r\\n|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_precede_them_partial_209_hb, "{\"template\":\" {{>partial}}\\n>\",\"data\":{},\"partials\":{\"partial\":\">\\n>\"},\"expected\":\" >\\n >>\",\"message\":\"Standalone tags should not require a newline to precede them. \\\" {{>partial}}\\n>\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_follow_them_partial_210_hb, "{\"template\":\">\\n {{>partial}}\",\"data\":{},\"partials\":{\"partial\":\">\\n>\"},\"expected\":\">\\n >\\n >\",\"message\":\"Standalone tags should not require a newline to follow them. \\\">\\n {{>partial}}\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(superfluous_in_tag_whitespace_should_be_ignored_partial_211_hb, "{\"template\":\"|{{> partial }}|\",\"data\":{\"boolean\":true},\"partials\":{\"partial\":\"[]\"},\"expected\":\"|[]|\",\"message\":\"Superfluous in-tag whitespace should be ignored. \\\"|{{> partial }}|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(truthy_sections_should_have_their_contents_rendered_boolean_this_should_be_rendered_boolean_212_hb, "{\"template\":\"\\\"{{#boolean}}This should be rendered.{{/boolean}}\\\"\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"\\\"This should be rendered.\\\"\",\"message\":\"Truthy sections should have their contents rendered. \\\"\\\"{{#boolean}}This should be rendered.{{/boolean}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(falsey_sections_should_have_their_contents_omitted_boolean_this_should_not_be_rendered_boolean_213_hb, "{\"template\":\"\\\"{{#boolean}}This should not be rendered.{{/boolean}}\\\"\",\"data\":{\"boolean\":false},\"partials\":{},\"expected\":\"\\\"\\\"\",\"message\":\"Falsey sections should have their contents omitted. \\\"\\\"{{#boolean}}This should not be rendered.{{/boolean}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(objects_and_hashes_should_be_pushed_onto_the_context_stack_context_hi_name_context_214_hb, "{\"template\":\"\\\"{{#context}}Hi {{name}}.{{/context}}\\\"\",\"data\":{\"context\":{\"name\":\"Joe\"}},\"partials\":{},\"expected\":\"\\\"Hi Joe.\\\"\",\"message\":\"Objects and hashes should be pushed onto the context stack. \\\"\\\"{{#context}}Hi {{name}}.{{/context}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(all_elements_on_the_context_stack_should_be_accessible_a_one_b_one_two_one_c_one_two_three_two_one_d_one_two_three_four_three_two_one_e_one_two_three_four_five_four_three_two_one_e_one_two_three_four_three_two_one_d_one_two_three_two_one_c_one_two_one_b_one_a_215_hb, "{\"template\":\"{{#a}}\\n{{one}}\\n{{#b}}\\n{{one}}{{two}}{{one}}\\n{{#c}}\\n{{one}}{{two}}{{three}}{{two}}{{one}}\\n{{#d}}\\n{{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}}\\n{{#e}}\\n{{one}}{{two}}{{three}}{{four}}{{five}}{{four}}{{three}}{{two}}{{one}}\\n{{/e}}\\n{{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}}\\n{{/d}}\\n{{one}}{{two}}{{three}}{{two}}{{one}}\\n{{/c}}\\n{{one}}{{two}}{{one}}\\n{{/b}}\\n{{one}}\\n{{/a}}\\n\",\"data\":{\"a\":{\"one\":1},\"b\":{\"two\":2},\"c\":{\"three\":3},\"d\":{\"four\":4},\"e\":{\"five\":5}},\"partials\":{},\"expected\":\"1\\n121\\n12321\\n1234321\\n123454321\\n1234321\\n12321\\n121\\n1\\n\",\"message\":\"All elements on the context stack should be accessible. \\\"{{#a}}\\n{{one}}\\n{{#b}}\\n{{one}}{{two}}{{one}}\\n{{#c}}\\n{{one}}{{two}}{{three}}{{two}}{{one}}\\n{{#d}}\\n{{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}}\\n{{#e}}\\n{{one}}{{two}}{{three}}{{four}}{{five}}{{four}}{{three}}{{two}}{{one}}\\n{{/e}}\\n{{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}}\\n{{/d}}\\n{{one}}{{two}}{{three}}{{two}}{{one}}\\n{{/c}}\\n{{one}}{{two}}{{one}}\\n{{/b}}\\n{{one}}\\n{{/a}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(lists_should_be_iterated_list_items_should_visit_the_context_stack_list_item_list_216_hb, "{\"template\":\"\\\"{{#list}}{{item}}{{/list}}\\\"\",\"data\":{\"list\":[{\"item\":1},{\"item\":2},{\"item\":3}]},\"partials\":{},\"expected\":\"\\\"123\\\"\",\"message\":\"Lists should be iterated; list items should visit the context stack. \\\"\\\"{{#list}}{{item}}{{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(empty_lists_should_behave_like_falsey_values_list_yay_lists_list_217_hb, "{\"template\":\"\\\"{{#list}}Yay lists!{{/list}}\\\"\",\"data\":{\"list\":[]},\"partials\":{},\"expected\":\"\\\"\\\"\",\"message\":\"Empty lists should behave like falsey values. \\\"\\\"{{#list}}Yay lists!{{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(multiple_sections_per_template_should_be_permitted_bool_first_bool_two_bool_third_bool_218_hb, "{\"template\":\"{{#bool}}\\n* first\\n{{/bool}}\\n* {{two}}\\n{{#bool}}\\n* third\\n{{/bool}}\\n\",\"data\":{\"two\":\"second\",\"bool\":true},\"partials\":{},\"expected\":\"* first\\n* second\\n* third\\n\",\"message\":\"Multiple sections per template should be permitted. \\\"{{#bool}}\\n* first\\n{{/bool}}\\n* {{two}}\\n{{#bool}}\\n* third\\n{{/bool}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(nested_truthy_sections_should_have_their_contents_rendered_a_bool_b_bool_c_bool_d_bool_e_219_hb, "{\"template\":\"| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |\",\"data\":{\"bool\":true},\"partials\":{},\"expected\":\"| A B C D E |\",\"message\":\"Nested truthy sections should have their contents rendered. \\\"| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(nested_falsey_sections_should_be_omitted_a_bool_b_bool_c_bool_d_bool_e_220_hb, "{\"template\":\"| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |\",\"data\":{\"bool\":false},\"partials\":{},\"expected\":\"| A E |\",\"message\":\"Nested falsey sections should be omitted. \\\"| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(failed_context_lookups_should_be_considered_falsey_missing_found_key_missing_missing_221_hb, "{\"template\":\"[{{#missing}}Found key 'missing'!{{/missing}}]\",\"data\":{},\"partials\":{},\"expected\":\"[]\",\"message\":\"Failed context lookups should be considered falsey. \\\"[{{#missing}}Found key 'missing'!{{/missing}}]\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(implicit_iterators_should_directly_interpolate_strings_list_list_222_hb, "{\"template\":\"\\\"{{#list}}({{.}}){{/list}}\\\"\",\"data\":{\"list\":[\"a\",\"b\",\"c\",\"d\",\"e\"]},\"partials\":{},\"expected\":\"\\\"(a)(b)(c)(d)(e)\\\"\",\"message\":\"Implicit iterators should directly interpolate strings. \\\"\\\"{{#list}}({{.}}){{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(implicit_iterators_should_cast_integers_to_strings_and_interpolate_list_list_223_hb, "{\"template\":\"\\\"{{#list}}({{.}}){{/list}}\\\"\",\"data\":{\"list\":[1,2,3,4,5]},\"partials\":{},\"expected\":\"\\\"(1)(2)(3)(4)(5)\\\"\",\"message\":\"Implicit iterators should cast integers to strings and interpolate. \\\"\\\"{{#list}}({{.}}){{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(implicit_iterators_should_cast_decimals_to_strings_and_interpolate_list_list_224_hb, "{\"template\":\"\\\"{{#list}}({{.}}){{/list}}\\\"\",\"data\":{\"list\":[1.1,2.2,3.3,4.4,5.5]},\"partials\":{},\"expected\":\"\\\"(1.1)(2.2)(3.3)(4.4)(5.5)\\\"\",\"message\":\"Implicit iterators should cast decimals to strings and interpolate. \\\"\\\"{{#list}}({{.}}){{/list}}\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_valid_for_section_tags_a_b_c_here_a_b_c_here_225_hb, "{\"template\":\"\\\"{{#a.b.c}}Here{{/a.b.c}}\\\" == \\\"Here\\\"\",\"data\":{\"a\":{\"b\":{\"c\":true}}},\"partials\":{},\"expected\":\"\\\"Here\\\" == \\\"Here\\\"\",\"message\":\"Dotted names should be valid for Section tags. \\\"\\\"{{#a.b.c}}Here{{/a.b.c}}\\\" == \\\"Here\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_should_be_valid_for_section_tags_a_b_c_here_a_b_c_226_hb, "{\"template\":\"\\\"{{#a.b.c}}Here{{/a.b.c}}\\\" == \\\"\\\"\",\"data\":{\"a\":{\"b\":{\"c\":false}}},\"partials\":{},\"expected\":\"\\\"\\\" == \\\"\\\"\",\"message\":\"Dotted names should be valid for Section tags. \\\"\\\"{{#a.b.c}}Here{{/a.b.c}}\\\" == \\\"\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(dotted_names_that_cannot_be_resolved_should_be_considered_falsey_a_b_c_here_a_b_c_227_hb, "{\"template\":\"\\\"{{#a.b.c}}Here{{/a.b.c}}\\\" == \\\"\\\"\",\"data\":{\"a\":{}},\"partials\":{},\"expected\":\"\\\"\\\" == \\\"\\\"\",\"message\":\"Dotted names that cannot be resolved should be considered falsey. \\\"\\\"{{#a.b.c}}Here{{/a.b.c}}\\\" == \\\"\\\"\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(sections_should_not_alter_surrounding_whitespace_boolean_boolean_228_hb, "{\"template\":\" | {{#boolean}}\\t|\\t{{/boolean}} | \\n\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\" | \\t|\\t | \\n\",\"message\":\"Sections should not alter surrounding whitespace. \\\" | {{#boolean}}\\t|\\t{{/boolean}} | \\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(sections_should_not_alter_internal_whitespace_boolean_important_whitespace_boolean_229_hb, "{\"template\":\" | {{#boolean}} {{! Important Whitespace }}\\n {{/boolean}} | \\n\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\" | \\n | \\n\",\"message\":\"Sections should not alter internal whitespace. \\\" | {{#boolean}} {{! Important Whitespace }}\\n {{/boolean}} | \\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(single_line_sections_should_not_alter_surrounding_whitespace_boolean_yes_boolean_boolean_good_boolean_230_hb, "{\"template\":\" {{#boolean}}YES{{/boolean}}\\n {{#boolean}}GOOD{{/boolean}}\\n\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\" YES\\n GOOD\\n\",\"message\":\"Single-line sections should not alter surrounding whitespace. \\\" {{#boolean}}YES{{/boolean}}\\n {{#boolean}}GOOD{{/boolean}}\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_lines_should_be_removed_from_the_template_this_is_boolean_boolean_a_line_231_hb, "{\"template\":\"| This Is\\n{{#boolean}}\\n|\\n{{/boolean}}\\n| A Line\\n\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"| This Is\\n|\\n| A Line\\n\",\"message\":\"Standalone lines should be removed from the template. \\\"| This Is\\n{{#boolean}}\\n|\\n{{/boolean}}\\n| A Line\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(indented_standalone_lines_should_be_removed_from_the_template_this_is_boolean_boolean_a_line_232_hb, "{\"template\":\"| This Is\\n {{#boolean}}\\n|\\n {{/boolean}}\\n| A Line\\n\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"| This Is\\n|\\n| A Line\\n\",\"message\":\"Indented standalone lines should be removed from the template. \\\"| This Is\\n {{#boolean}}\\n|\\n {{/boolean}}\\n| A Line\\n\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(_r_n_should_be_considered_a_newline_for_standalone_tags_boolean_boolean_233_hb, "{\"template\":\"|\\r\\n{{#boolean}}\\r\\n{{/boolean}}\\r\\n|\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"|\\r\\n|\",\"message\":\"\\\"\\\\r\\\\n\\\" should be considered a newline for standalone tags. \\\"|\\r\\n{{#boolean}}\\r\\n{{/boolean}}\\r\\n|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_precede_them_boolean_boolean_234_hb, "{\"template\":\" {{#boolean}}\\n#{{/boolean}}\\n/\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"#\\n/\",\"message\":\"Standalone tags should not require a newline to precede them. \\\" {{#boolean}}\\n#{{/boolean}}\\n/\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(standalone_tags_should_not_require_a_newline_to_follow_them_boolean_boolean_235_hb, "{\"template\":\"#{{#boolean}}\\n/\\n {{/boolean}}\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"#\\n/\\n\",\"message\":\"Standalone tags should not require a newline to follow them. \\\"#{{#boolean}}\\n/\\n {{/boolean}}\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(superfluous_in_tag_whitespace_should_be_ignored_boolean_boolean_236_hb, "{\"template\":\"|{{# boolean }}={{/ boolean }}|\",\"data\":{\"boolean\":true},\"partials\":{},\"expected\":\"|=|\",\"message\":\"Superfluous in-tag whitespace should be ignored. \\\"|{{# boolean }}={{/ boolean }}|\\\"\",\"options\":{\"compat\":true,\"data\":true,\"useDepths\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_237_hb, "{\"template\":\" {{~foo~}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar<\"}"); hbtest!(test_238_hb, "{\"template\":\" {{~foo}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar< \"}"); hbtest!(test_239_hb, "{\"template\":\" {{foo~}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\" bar<\"}"); hbtest!(test_240_hb, "{\"template\":\" {{~&foo~}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar<\"}"); hbtest!(test_241_hb, "{\"template\":\" {{~{foo}~}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar<\"}"); hbtest!(test_242_hb, "{\"template\":\"1\\n{{foo~}} \\n\\n 23\\n{{bar}}4\",\"data\":{},\"expected\":\"1\\n23\\n4\"}"); hbtest!(test_243_hb, "{\"template\":\"foo {{~> dude~}} \",\"data\":{},\"partials\":{\"dude\":\"bar\"},\"expected\":\"foobar\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_244_hb, "{\"template\":\"foo {{> dude~}} \",\"data\":{},\"partials\":{\"dude\":\"bar\"},\"expected\":\"foo bar\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_245_hb, "{\"template\":\"foo {{> dude}} \",\"data\":{},\"partials\":{\"dude\":\"bar\"},\"expected\":\"foo bar \",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_246_hb, "{\"template\":\"foo\\n {{~> dude}} \",\"data\":{},\"partials\":{\"dude\":\"bar\"},\"expected\":\"foobar\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_247_hb, "{\"template\":\"foo\\n {{> dude}} \",\"data\":{},\"partials\":{\"dude\":\"bar\"},\"expected\":\"foo\\n bar\",\"options\":{\"data\":true,\"blockParams\":[],\"knownHelpers\":{\"helperMissing\":true,\"blockHelperMissing\":true,\"each\":true,\"if\":true,\"unless\":true,\"with\":true,\"log\":true,\"lookup\":true}}}"); hbtest!(test_248_hb, "{\"template\":\" {{~foo~}} {{foo}} {{foo}} \",\"data\":{\"foo\":\"bar\"},\"expected\":\"barbar bar \"}"); hbtest!(test_249_hb, "{\"template\":\" {{~#if foo~}} bar {{~/if~}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar\"}"); hbtest!(test_250_hb, "{\"template\":\" {{#if foo~}} bar {{/if~}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\" bar \"}"); hbtest!(test_251_hb, "{\"template\":\" {{~#if foo}} bar {{~/if}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\" bar \"}"); hbtest!(test_252_hb, "{\"template\":\" {{#if foo}} bar {{/if}} \",\"data\":{\"foo\":\"bar<\"},\"expected\":\" bar \"}"); hbtest!(test_253_hb, "{\"template\":\" \\n\\n{{~#if foo~}} \\n\\nbar \\n\\n{{~/if~}}\\n\\n \",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar\"}"); hbtest!(test_254_hb, "{\"template\":\" a\\n\\n{{~#if foo~}} \\n\\nbar \\n\\n{{~/if~}}\\n\\na \",\"data\":{\"foo\":\"bar<\"},\"expected\":\" abara \"}"); hbtest!(test_255_hb, "{\"template\":\" {{~^if foo~}} bar {{~/if~}} \",\"data\":{},\"expected\":\"bar\"}"); hbtest!(test_256_hb, "{\"template\":\" {{^if foo~}} bar {{/if~}} \",\"data\":{},\"expected\":\" bar \"}"); hbtest!(test_257_hb, "{\"template\":\" {{~^if foo}} bar {{~/if}} \",\"data\":{},\"expected\":\" bar \"}"); hbtest!(test_258_hb, "{\"template\":\" {{^if foo}} bar {{/if}} \",\"data\":{},\"expected\":\" bar \"}"); hbtest!(test_259_hb, "{\"template\":\" \\n\\n{{~^if foo~}} \\n\\nbar \\n\\n{{~/if~}}\\n\\n \",\"data\":{},\"expected\":\"bar\"}"); hbtest!(test_260_hb, "{\"template\":\"{{#if foo~}} bar {{~^~}} baz {{~/if}}\",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar\"}"); hbtest!(test_261_hb, "{\"template\":\"{{#if foo~}} bar {{^~}} baz {{/if}}\",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar \"}"); hbtest!(test_262_hb, "{\"template\":\"{{#if foo}} bar {{~^~}} baz {{~/if}}\",\"data\":{\"foo\":\"bar<\"},\"expected\":\" bar\"}"); hbtest!(test_263_hb, "{\"template\":\"{{#if foo}} bar {{^~}} baz {{/if}}\",\"data\":{\"foo\":\"bar<\"},\"expected\":\" bar \"}"); hbtest!(test_264_hb, "{\"template\":\"{{#if foo~}} bar {{~else~}} baz {{~/if}}\",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar\"}"); hbtest!(test_265_hb, "{\"template\":\"\\n\\n{{~#if foo~}} \\n\\nbar \\n\\n{{~^~}} \\n\\nbaz \\n\\n{{~/if~}}\\n\\n\",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar\"}"); hbtest!(test_266_hb, "{\"template\":\"\\n\\n{{~#if foo~}} \\n\\n{{{foo}}} \\n\\n{{~^~}} \\n\\nbaz \\n\\n{{~/if~}}\\n\\n\",\"data\":{\"foo\":\"bar<\"},\"expected\":\"bar<\"}"); hbtest!(test_267_hb, "{\"template\":\"{{#if foo~}} bar {{~^~}} baz {{~/if}}\",\"data\":{},\"expected\":\"baz\"}"); hbtest!(test_268_hb, "{\"template\":\"{{#if foo}} bar {{~^~}} baz {{/if}}\",\"data\":{},\"expected\":\"baz \"}"); hbtest!(test_269_hb, "{\"template\":\"{{#if foo~}} bar {{~^}} baz {{~/if}}\",\"data\":{},\"expected\":\" baz\"}"); hbtest!(test_270_hb, "{\"template\":\"{{#if foo~}} bar {{~^}} baz {{/if}}\",\"data\":{},\"expected\":\" baz \"}"); hbtest!(test_271_hb, "{\"template\":\"{{#if foo~}} bar {{~else~}} baz {{~/if}}\",\"data\":{},\"expected\":\"baz\"}"); hbtest!(test_272_hb, "{\"template\":\"\\n\\n{{~#if foo~}} \\n\\nbar \\n\\n{{~^~}} \\n\\nbaz \\n\\n{{~/if~}}\\n\\n\",\"data\":{},\"expected\":\"baz\"}");