# 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 monadic
import dyadic
import strings
import zilde
import mixed
import nested
import prototypes
import matrix
        import doctest
#!/usr/bin/python3
"""
    template for test cases for one APL function pulled from other test modules

    Tests both the monadic and dyadic forms of the function.  For example:

        test/function iota

    The preamble allows the tests to be run with either eager or lazy evaluation.
"""


# 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/function.py
from test.base import preamble, testResult as test
from test.base import saveIndexOrigin, setIndexOrigin, restoreIndexOrigin
import monadic
import dyadic
import strings
import zilde
import mixed
import nested
import prototypes
import matrix
        import doctest

#!/usr/bin/python3
"""
    template for test cases for one APL function pulled from other test modules

    Tests both the monadic and dyadic forms of the function.  For example:

        test/function iota

    The preamble allows the tests to be run with either eager or lazy evaluation.
"""


from test.base import saveIndexOrigin, setIndexOrigin, restoreIndexOrigin