Exemple #1
0
 def test_selections(self):
     assert ref.selections('') == []
     assert ref.selections('a1') == ['a1']
     assert ref.selections('a1[3:5]') == ['a1[3:5]']
     assert ref.selections('a1[3:5+6:7]') == ['a1[3:5+6:7]']
     assert ref.selections('a1[3:5+6:7]+a2[1:4]') == ['a1[3:5+6:7]', '+', 'a2[1:4]']
     assert ref.selections('a1 a2  a3') == ['a1', ' ', 'a2', '  ', 'a3']
     assert ref.selections('a1 123 a2') == ['a1', ' 123 ', 'a2']
     assert ref.selections('a1 [1:3]+a2') == ['a1', ' [1:3]+', 'a2']
     assert ref.selections('a1+a2', keep_delimiters=False) == ['a1', 'a2']
Exemple #2
0
 def test_selections(self):
     self.assertEqual(ref.selections(''), [])
     self.assertEqual(ref.selections('a1'),
                                    ['a1'])
     self.assertEqual(ref.selections('a1[3:5]'),
                                    ['a1[3:5]'])
     self.assertEqual(ref.selections('a1[3:5+6:7]'),
                                    ['a1[3:5+6:7]'])
     self.assertEqual(ref.selections('a1[3:5+6:7]+a2[1:4]'),
                                    ['a1[3:5+6:7]', '+', 'a2[1:4]'])
     self.assertEqual(ref.selections('a1 a2  a3'),
                                    ['a1', ' ', 'a2', '  ', 'a3'])
     self.assertEqual(ref.selections('a1 123 a2'),
                                    ['a1', ' 123 ', 'a2'])
     self.assertEqual(ref.selections('a1 [1:3]+a2'),
                                    ['a1', ' [1:3]+', 'a2'])
     self.assertEqual(ref.selections('a1+a2', keep_delimiters=False),
                                    ['a1', 'a2'])