# Path: test/base.py
# def     preamble():
#     """
#     process command line flags - see <test-script> -h
#     """
#     flags, args = parseCommandLineArgs(sys.argv)
# 
#     for flag in flags:
#         if flag in ("-ee=0", "--lazy"):
#             systemVariables.setEvaluationMode(0)
# 
#         elif flag in ("-ee=1", "--eager"):
#             systemVariables.setEvaluationMode(1)
# 
#         elif flag in "-io=0":
#             systemVariables.setIndexOrigin(0)
# 
#         elif flag in "-io=1":
#             systemVariables.setIndexOrigin(1)
# 
#         elif flag in ("-h", "--help"):
#             print(_help())
#             aplQuit(0)
# 
#         else:
#             aplQuit(3, "{0} not recognised: perhaps try -h".format(flag))
# 
# def     testResult(expr, overrideLazy=False):
#     """
#     evaluate an expression then format and print the result
# 
#     handle both positive and negative outcomes
# 
#     Often the negative outcome in lazy evaluation mode involves printing backspaces
# 
#         doctest.NORMALIZE_WHITESPACE = 1
# 
#     does not have the desired effect, hence the messing around the with the evaluation mode.
#     """
#     if overrideLazy:
#         overrideLazy = not systemVariables.eagerEvaluation()
# 
#     if overrideLazy:
#         systemVariables.setEvaluationMode(1)
# 
#     try:
#         cio = aplCio()
#         cio.printResult(evaluate(expr, cio))
#     except aplException as error:
#         print(error.message)
# 
#     if overrideLazy:
#         systemVariables.setEvaluationMode(0)
# 
# Path: test/base.py
# def     saveIndexOrigin():
#     """
#     return ⎕IO so the test function can save it
#     """
#     return systemVariables.indexOrigin()
# 
# def     setIndexOrigin(io):
#     """
#     set ⎕IO:  it is assumed the test function has saved and will restore the original value
#     """
#     systemVariables.setIndexOrigin(io)
# 
# def     restoreIndexOrigin(io):
#     """
#     restore ⎕IO previously retrieved by the test function using saveIndexOrigin
#     """
#     systemVariables.setIndexOrigin(io)


from test.base import preamble, testResult as test
from test.base import saveIndexOrigin, setIndexOrigin, restoreIndexOrigin
        import doctest

    >>> test(r"A ← 'abcdefghijklmnopqrstuvwxyz'")
    abcdefghijklmnopqrstuvwxyz

    >>> test(r"A ⍒ 'azbycx'")
    1 3 5 4 2 0
    >>> test(r"A ⍒ 'xcybza'")
    4 2 0 1 3 5

    >>> test(r"A ⍒ 'aZbYcX'")
    1 3 5 4 2 0
    >>> test(r"A ⍒ 'XcYbZa'")
    0 2 4 1 3 5

    >>> test(r"A ← ⌽A")
    zyxwvutsrqponmlkjihgfedcba

    >>> test(r"A ⍒ 'azbycx'")
    0 2 4 5 3 1
    >>> test(r"A ⍒ 'xcybza'")
    5 3 1 0 2 4

    >>> restoreIndexOrigin(IO)
    """
    pass

# ------------------------------

if __name__ == "__main__":
    preamble()

# Path: test/base.py
# def     preamble():
#     """
#     process command line flags - see <test-script> -h
#     """
#     flags, args = parseCommandLineArgs(sys.argv)
# 
#     for flag in flags:
#         if flag in ("-ee=0", "--lazy"):
#             systemVariables.setEvaluationMode(0)
# 
#         elif flag in ("-ee=1", "--eager"):
#             systemVariables.setEvaluationMode(1)
# 
#         elif flag in "-io=0":
#             systemVariables.setIndexOrigin(0)
# 
#         elif flag in "-io=1":
#             systemVariables.setIndexOrigin(1)
# 
#         elif flag in ("-h", "--help"):
#             print(_help())
#             aplQuit(0)
# 
#         else:
#             aplQuit(3, "{0} not recognised: perhaps try -h".format(flag))
# 
# def     testResult(expr, overrideLazy=False):
#     """
#     evaluate an expression then format and print the result
# 
#     handle both positive and negative outcomes
# 
#     Often the negative outcome in lazy evaluation mode involves printing backspaces
# 
#         doctest.NORMALIZE_WHITESPACE = 1
# 
#     does not have the desired effect, hence the messing around the with the evaluation mode.
#     """
#     if overrideLazy:
#         overrideLazy = not systemVariables.eagerEvaluation()
# 
#     if overrideLazy:
#         systemVariables.setEvaluationMode(1)
# 
#     try:
#         cio = aplCio()
#         cio.printResult(evaluate(expr, cio))
#     except aplException as error:
#         print(error.message)
# 
#     if overrideLazy:
#         systemVariables.setEvaluationMode(0)
# 
# Path: test/base.py
# def     saveIndexOrigin():
#     """
#     return ⎕IO so the test function can save it
#     """
#     return systemVariables.indexOrigin()
# 
# def     setIndexOrigin(io):
#     """
#     set ⎕IO:  it is assumed the test function has saved and will restore the original value
#     """
#     systemVariables.setIndexOrigin(io)
# 
# def     restoreIndexOrigin(io):
#     """
#     restore ⎕IO previously retrieved by the test function using saveIndexOrigin
#     """
#     systemVariables.setIndexOrigin(io)


# Path: test/strings.py
from test.base import preamble, testResult as test
from test.base import saveIndexOrigin, setIndexOrigin, restoreIndexOrigin
        import doctest


    >>> test(r"A ← 'abcdefghijklmnopqrstuvwxyz'")
    abcdefghijklmnopqrstuvwxyz

    >>> test(r"A ⍒ 'azbycx'")
    1 3 5 4 2 0
    >>> test(r"A ⍒ 'xcybza'")
    4 2 0 1 3 5

    >>> test(r"A ⍒ 'aZbYcX'")
    1 3 5 4 2 0
    >>> test(r"A ⍒ 'XcYbZa'")
    0 2 4 1 3 5

    >>> test(r"A ← ⌽A")
    zyxwvutsrqponmlkjihgfedcba

    >>> test(r"A ⍒ 'azbycx'")
    0 2 4 5 3 1
    >>> test(r"A ⍒ 'xcybza'")
    5 3 1 0 2 4

    >>> restoreIndexOrigin(IO)
    """
    pass

# ------------------------------

if __name__ == "__main__":
    preamble()

    if test and __name__: