# Path: medea/bytestring.py
# def generateStringBytes(byteString):
#     """
#     Invoke with gen.send(False) to read previous byte (NO increment ONLY read)
#     Invoke with gen.send(non-False) e.g. next(gen) to move cursor to next byte (DO increment AND read)
#     """
#     if type(byteString) == str:
#         byteString = byteString.encode("ascii")
#     pos = 0
#     count = len(byteString)
#     while pos < count:
#         if (yield byteString[pos]) is None:
#             pos += 1


from medea.bytestring import generateStringBytes

def verifyGeneratedTokens(tokenizeMethod, byteString, expectedSequence):
    byteGenerator = generateStringBytes(byteString)
    generatedSequence = list(tokenizeMethod(byteGenerator))
    expectedSequence = list(expectedSequence)

# Path: medea/bytestring.py
# def generateStringBytes(byteString):
#     """
#     Invoke with gen.send(False) to read previous byte (NO increment ONLY read)
#     Invoke with gen.send(non-False) e.g. next(gen) to move cursor to next byte (DO increment AND read)
#     """
#     if type(byteString) == str:
#         byteString = byteString.encode("ascii")
#     pos = 0
#     count = len(byteString)
#     while pos < count:
#         if (yield byteString[pos]) is None:
#             pos += 1


# Path: tests/helpers.py
from medea.bytestring import generateStringBytes


def verifyGeneratedTokens(tokenizeMethod, byteString, expectedSequence):
    byteGenerator = generateStringBytes(byteString)
    generatedSequence = list(tokenizeMethod(byteGenerator))
    expectedSequence = list(expectedSequence)

    for generated, expected in zip(generatedSequence, expectedSequence):