Skip to content
Myr

Add float/complex testcases for `is number`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ThiefMaster · committed by ThiefMaster · parent 9bf5fcb · Browse files · 1 file+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:jinja2/testsuite/tests.py+4 added-2 removed
51 unmodified lines
52 {{ mydict is mapping }}53 {{ [] is mapping }}54 {{ 10 is number }}55 {{ (10 ** 100) is number }}56 {{ 3.14159 is number }}57 {{ complex is number }}58 ''')59 class MyDict(dict):60 pass59 assert tmpl.render(mydict=MyDict()).split() == [61 assert tmpl.render(mydict=MyDict(), complex=complex(1, 2)).split() == [62 'False', 'True', 'False', 'True', 'True', 'False',63 'True', 'True', 'True', 'True', 'False', 'True',62 'True', 'True', 'False', 'True', 'True'64 'True', 'True', 'False', 'True', 'True', 'True', 'True'65 ]6667 def test_sequence(self):68 tmpl = env.from_string(
40 unmodified lines