assert sub_string("abc", "aBc") == "_B_" assert add_string("abc", "_B_") == "aBc" s = Str("abcdefghij") assert [ s, s << 1, s >> 1, (s << 1) >> 1, s << 2, s << 3, s << 4] == \ ['abcdefghij', 'bcdefghija', 'jabcdefghi', 'abcdefghij', 'cdefghijab', 'defghijabc', 'efghijabcd'] assert s.setstart("d") == "defghijabc" s = Str('abcaba') assert s.indexes("a") == [0, 3, 5] assert s.indexes("d") == [] s = Str("abcdefghij") import pprint assert [s.insert("1", 2), s.insert("12", 2), s.overwrite("1", 2), s.overwrite("12", 2)] == \ ['ab1cdefghij', 'ab12cdefghij', 'ab1defghij', 'ab12efghij'] assert [s.splitblock(2), s.splitblock(3)] == [['ab', 'cd', 'ef', 'gh', 'ij'], ['abc', 'def', 'ghi', 'j']] assert List([1, 2, 3, 4]) >> 1 == [4, 1, 2, 3] assert List([1, 2, 3, 4]) >> 4 == [1, 2, 3, 4] assert List([1, 2, 3, 4]) << 1 == [2, 3, 4, 1] assert 0xFFCD9AD6 == Dword(251972843051734) assert 0x9AD6 == Word(251972843051734) assert 0xD6 == Byte(251972843051734) assert str(Qword(17)) == "0000000000000011" assert 214 == Byte(251972843051734) assert Byte(15 + 1) == Byte(15) + 1