Commit 059e48cc authored by Philipp Wolfer's avatar Philipp Wolfer

AngularJS check: Added tests for extended formatting syntax.

parent 178f8834
......@@ -76,15 +76,27 @@ class AngularJSInterpolationCheckTest(TestCase):
MockUnit('angularjs_wrong_value', flags='angularjs-format')
))
def test_extended_formatting(self):
self.assertFalse(self.check.check_single(
u'Value: {{ something.value | currency }}',
u'Wert: {{ something.value | currency }}',
MockUnit('angularjs_format', flags='angularjs-format')
))
self.assertTrue(self.check.check_single(
u'Value: {{ something.value | currency }}',
u'Value: {{ something.value }}',
MockUnit('angularjs_format', flags='angularjs-format')
))
def test_check_highlight(self):
highlights = self.check.check_highlight(
u'{{name}} {{other}} string',
u'{{name}} {{ something.value | currency }} string',
MockUnit('angularjs_format', flags='angularjs-format'))
self.assertEqual(2, len(highlights))
self.assertEqual(0, highlights[0][0])
self.assertEqual(8, highlights[0][1])
self.assertEqual(9, highlights[1][0])
self.assertEqual(18, highlights[1][1])
self.assertEqual(41, highlights[1][1])
def test_check_highlight_ignored(self):
highlights = self.check.check_highlight(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment