From 3f64f1d24ca70694215e07e068de5890fb809682 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sat, 12 Nov 2011 11:56:47 +0100 Subject: [PATCH] added test for hash keys --- test/Twig/Tests/Fixtures/expressions/array.test | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/test/Twig/Tests/Fixtures/expressions/array.test b/test/Twig/Tests/Fixtures/expressions/array.test index 8431540..5b81a0e 100644 --- a/test/Twig/Tests/Fixtures/expressions/array.test +++ b/test/Twig/Tests/Fixtures/expressions/array.test @@ -27,6 +27,13 @@ Twig supports array notation 2, ]|join(',') }} + +{# keys can be any expression #} +{% set a = 1 %} +{% set b = "foo" %} +{% set ary = { a: 'a', b: 'b', 'c': 'c', a~b: 'd' } %} +{{ ary|keys|join(',') }} +{{ ary|join(',') }} --DATA-- return array('bar' => 'bar', 'foo' => array('bar' => 'bar')) --EXPECT-- -- 1.7.2.5