'Verifies that slicing an ANSIString results in expected color code
distribution.'

def test_slice(self):

    target = ANSIString('|gTest|rTest|n')
    result = target[:3]
    self.checker(result, u'\x1b[1m\x1b[32mTes', u'Tes')
    result = target[:4]
    self.checker(result, u'\x1b[1m\x1b[32mTest\x1b[1m\x1b[31m', u'Test')
    result = target[:]
    self.checker(result, u'\x1b[1m\x1b[32mTest\x1b[1m\x1b[31mTest\x1b[0m', u'TestTest')
    result = target[:(-1)]
    self.checker(result, u'\x1b[1m\x1b[32mTest\x1b[1m\x1b[31mTes', u'TestTes')
    result = target[0:0]
    self.checker(result, u'', u'')
