Example #1
0
 def test_compress(self):
     assert ref.compress('') == ''
     assert ref.compress('a1') == 'a1'
     assert ref.compress('a1[3:5]') == 'a1[3:5]'
     assert ref.compress('a1[3:5+6:7]') == 'a1[3:5+6:7]'
     assert ref.compress('a1[3:5]+a1[6:7]') == 'a1[3:5+6:7]'
     assert ref.compress('a1[3:5]+a1') == 'a1[3:5]+a1'
     assert ref.compress('a1+a1[6:7]') == 'a1+a1[6:7]'
     assert ref.compress('a1[3:5]+a1[5:7]') == 'a1[3:5+5:7]'
     assert ref.compress('a1[3:5]+a2[6:7]') == 'a1[3:5]+a2[6:7]'
     assert ref.compress('a1[3:5]+a2[6:7]+a1[5:6]') == 'a1[3:5]+a2[6:7]+a1[5:6]'
     assert ref.compress('a1[3:5]+a1[6:7],a1[1:2,2:3]') == 'a1[3:5+6:7,1:2,2:3]'
     assert ref.compress('a1 a2  a3') == 'a1 a2  a3'
     assert ref.compress('a1[1:2]+[2:3]') == 'a1[1:2]+[2:3]'
Example #2
0
 def test_compress(self):
     self.assertEqual(ref.compress(''), '')
     self.assertEqual(ref.compress('a1'),
                                   'a1')
     self.assertEqual(ref.compress('a1[3:5]'),
                                   'a1[3:5]')
     self.assertEqual(ref.compress('a1[3:5+6:7]'),
                                   'a1[3:5+6:7]')
     self.assertEqual(ref.compress('a1[3:5]+a1[6:7]'),
                                   'a1[3:5+6:7]')
     self.assertEqual(ref.compress('a1[3:5]+a1'),
                                   'a1[3:5]+a1')
     self.assertEqual(ref.compress('a1+a1[6:7]'),
                                   'a1+a1[6:7]')
     self.assertEqual(ref.compress('a1[3:5]+a1[5:7]'),
                                   'a1[3:5+5:7]')
     self.assertEqual(ref.compress('a1[3:5]+a2[6:7]'),
                                   'a1[3:5]+a2[6:7]')
     self.assertEqual(ref.compress('a1[3:5]+a2[6:7]+a1[5:6]'),
                                   'a1[3:5]+a2[6:7]+a1[5:6]')
     self.assertEqual(ref.compress('a1[3:5]+a1[6:7],a1[1:2,2:3]'),
                                   'a1[3:5+6:7,1:2,2:3]')
     self.assertEqual(ref.compress('a1 a2  a3'),
                                   'a1 a2  a3')
     self.assertEqual(ref.compress('a1[1:2]+[2:3]'),
                                   'a1[1:2]+[2:3]')