diff options
author | Yehuda Katz <wycats@gmail.com> | 2011-12-27 01:21:53 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2011-12-27 01:21:53 -0800 |
commit | 373d10edb1b3ff918c5d2c2965d2e243b05b1c21 (patch) | |
tree | d241a2a15b401fdfc34eb2aaefcd0491879da932 /spec/qunit_spec.js | |
parent | bd0f74fbd9c80aa148a66012b9db51df102eda64 (diff) | |
download | handlebars.js-373d10edb1b3ff918c5d2c2965d2e243b05b1c21.zip handlebars.js-373d10edb1b3ff918c5d2c2965d2e243b05b1c21.tar.gz handlebars.js-373d10edb1b3ff918c5d2c2965d2e243b05b1c21.tar.bz2 |
Literal square-bracket path segments cannot have ] in them. TODO: Allow escaped path segments.
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r-- | spec/qunit_spec.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js index 1935cd2..9ae8396 100644 --- a/spec/qunit_spec.js +++ b/spec/qunit_spec.js @@ -135,11 +135,6 @@ test("literal paths", function() { "Goodbye beautiful world!", "Literal paths can be used"); }); -test("literal paths with square brackets in them", function() { - shouldCompileTo("Goodbye {{[@alan]]/expression}} world!", {"@alan]": {expression: "beautiful"}}, - "Goodbye beautiful world!", "Literal paths with square brackets in them can be used"); -}); - test("--- TODO --- bad idea nested paths", function() { return; var hash = {goodbyes: [{text: "goodbye"}, {text: "Goodbye"}, {text: "GOODBYE"}], world: "world"}; @@ -1005,3 +1000,10 @@ test("Mustache man page", function() { shouldCompileTo(string, data, "Hello Chris. You have just won $10000! Well, $6000, after taxes.", "the hello world mustache example works"); }); + +test("GH-158: Using array index twice, breaks the template", function() { + var string = "{{arr.[0]}}, {{arr.[1]}}"; + var data = { "arr": [1,2] }; + + shouldCompileTo(string, data, "1, 2", "it works as expected"); +}); |