Refs #28721 -- Added test for variations of 'inf'/'infinity' as a template variable names.

Fixed by 9ec7d8e514.
This commit is contained in:
Levi Payne 2017-10-21 20:55:26 -04:00 committed by Tim Graham
parent 9ec7d8e514
commit 6c3104221b
1 changed files with 9 additions and 0 deletions

View File

@ -11,3 +11,12 @@ class VariableDoesNotExistTests(SimpleTestCase):
class VariableTests(SimpleTestCase): class VariableTests(SimpleTestCase):
def test_integer_literals(self): def test_integer_literals(self):
self.assertEqual(Variable('999999999999999999999999999').literal, 999999999999999999999999999) self.assertEqual(Variable('999999999999999999999999999').literal, 999999999999999999999999999)
def test_nonliterals(self):
"""Variable names that aren't resolved as literals."""
var_names = []
for var in ('inf', 'infinity', 'iNFiniTy', 'nan'):
var_names.extend((var, '-' + var, '+' + var))
for var in var_names:
with self.subTest(var=var):
self.assertIsNone(Variable(var).literal)