From dd257b3d663cde982ee98e0283bdcba5408c9a96 Mon Sep 17 00:00:00 2001 From: Michael Go Date: Mon, 30 Jan 2023 20:36:14 -0400 Subject: [PATCH] add an unit test for double nest variable lookup --- test/integration/variable_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/integration/variable_test.rb b/test/integration/variable_test.rb index 192a3fe9..0cb8bddc 100644 --- a/test/integration/variable_test.rb +++ b/test/integration/variable_test.rb @@ -157,4 +157,16 @@ class VariableTest < Minitest::Test } ) end + + def test_double_nested_variable_lookup + assert_template_result( + 'bar', + '{{ list[list[settings.zero]]["foo"] }}', + { + 'list' => [1, { 'foo' => 'bar' }], + 'settings' => SettingsDrop.new("zero" => 0), + 'bar' => 'foo', + } + ) + end end