@@ -506,6 +506,17 @@ def get_template_tests(self):
506
506
'basic-syntax28' : ("{{ a.b }}" , {'a' : SilentGetItemClass ()}, ('' , 'INVALID' )),
507
507
'basic-syntax29' : ("{{ a.b }}" , {'a' : SilentAttrClass ()}, ('' , 'INVALID' )),
508
508
509
+ # Something that starts like a number but has an extra lookup works as a lookup.
510
+ 'basic-syntax30' : ("{{ 1.2.3 }}" , {"1" : {"2" : {"3" : "d" }}}, "d" ),
511
+ 'basic-syntax31' : ("{{ 1.2.3 }}" , {"1" : {"2" : ("a" , "b" , "c" , "d" )}}, "d" ),
512
+ 'basic-syntax32' : ("{{ 1.2.3 }}" , {"1" : (("x" , "x" , "x" , "x" ), ("y" , "y" , "y" , "y" ), ("a" , "b" , "c" , "d" ))}, "d" ),
513
+ 'basic-syntax33' : ("{{ 1.2.3 }}" , {"1" : ("xxxx" , "yyyy" , "abcd" )}, "d" ),
514
+ 'basic-syntax34' : ("{{ 1.2.3 }}" , {"1" : ({"x" : "x" }, {"y" : "y" }, {"z" : "z" , "3" : "d" })}, "d" ),
515
+
516
+ # Numbers are numbers even if their digits are in the context.
517
+ 'basic-syntax35' : ("{{ 1 }}" , {"1" : "abc" }, "1" ),
518
+ 'basic-syntax36' : ("{{ 1.2 }}" , {"1" : "abc" }, "1.2" ),
519
+
509
520
# List-index syntax allows a template to access a certain item of a subscriptable object.
510
521
'list-index01' : ("{{ var.1 }}" , {"var" : ["first item" , "second item" ]}, "second item" ),
511
522
0 commit comments