Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')
def test_char_width_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 1, 2), 'b')
self.assertEqual(width_aware_slice('aEbc', 0, 4), 'aEb')
self.assertEqual(width_aware_slice('aEbc', 1, 4), 'Eb')
self.assertEqual(width_aware_slice('aEbc', 2, 4), ' b')
self.assertEqual(width_aware_slice('aEbc', 0, 2), 'a ')
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')
def test_char_width_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 1, 2), 'b')
self.assertEqual(width_aware_slice('aEbc', 0, 4), 'aEb')
self.assertEqual(width_aware_slice('aEbc', 1, 4), 'Eb')
self.assertEqual(width_aware_slice('aEbc', 2, 4), ' b')
self.assertEqual(width_aware_slice('aEbc', 0, 2), 'a ')
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')
def test_char_width_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 1, 2), 'b')
self.assertEqual(width_aware_slice('aEbc', 0, 4), 'aEb')
self.assertEqual(width_aware_slice('aEbc', 1, 4), 'Eb')
self.assertEqual(width_aware_slice('aEbc', 2, 4), ' b')
self.assertEqual(width_aware_slice('aEbc', 0, 2), 'a ')
def test_combining_char_aware_slice(self):
self.assertEqual(width_aware_slice('abc', 0, 2), 'ab')
self.assertEqual(width_aware_slice('abc', 1, 3), 'bc')
self.assertEqual(width_aware_slice('abc', 0, 3), 'abc')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 3), 'ab\u0300c')
self.assertEqual(width_aware_slice('ab\u0300c', 0, 2), 'ab\u0300')
self.assertEqual(width_aware_slice('ab\u0300c', 1, 3), 'b\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 1, 3), 'b\u0300\u0300c')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 0, 2), 'ab\u0300\u0300')
self.assertEqual(width_aware_slice('ab\u0300\u0300c', 2, 3), 'c')