Skip to content

Commit

Permalink
Add new tests for symbol regex.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelyah committed Oct 11, 2019
1 parent f988dbf commit dec790c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/widgets/test_colour_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,10 @@ def test_quote_undefined_or_no_quote_equals_none(self):
'alot.commands.globals.settings._theme', DUMMY_THEME)
def test_regex_symbol_is_correct(self):
# Match 4th level quote
self.assertEqual(parse_quotes('Aaa A'), AttrSpec('#580', '#586'))
self.assertEqual(parse_quotes('Aa<>tb A'), AttrSpec('#580', '#586'))
self.assertEqual(parse_quotes('Aaa A'), AttrSpec('#401', '#402'))

self.assertIsNone(parse_quotes('One symbol at the end <>!b'))
self.assertEqual(parse_quotes('Aa<>tb Ah, so much fun'), AttrSpec('#401', '#402'))
self.assertEqual(parse_quotes('> A symbol at the begining'), AttrSpec('#201', '#202'))
self.assertEqual(parse_quotes('A A symbols every> where>>! >>'), AttrSpec('#201', '#202'))
self.assertEqual(parse_quotes('A>A or A<A ?'), AttrSpec('#301', '#302'))

0 comments on commit dec790c

Please sign in to comment.