# Tests that generate a lot of output without interaction are flaky.
# In BASIC, we can kick the output with a newline, as long as we
# are careful to attempt a match on the longest successful result first,
# and permit additional newlines at the end.
# Earlier attempts at sending the XOFF character '\0x011' simply failed.
# Sometimes OS/8 would echo the string "X011" instead of getting XOFF.
'snoopy':
    'start': ["R BASIC\r", [["NEW OR OLD--$", 'old']]]
    'old':   ["OLD\r", [["FILE NAME--$", 'name']]]
    'name':  ["SNOOPY.BA\r", [["READY\r\n$", 'run']]]
    'run':   ["RUN\r", [["WHICH ONE\\?$", 'kbd']]]
    'kbd':   ["1\r", [
                ["^1$", 'kick'],
                [".*CURSE  YOU  RED  BARON.*\r\nREADY\r\n$", 'quit']
        ]
    ]
    'kick':  ["\r", [[".*CURSE  YOU  RED  BARON.*\r\nREADY\r\n", 'quit']]]
    'quit':  ["\x03", [["\n\\.$", 'success']]]

'hello':
    'start': ["R BASIC\r", [["NEW OR OLD--$", 'old']]]
    'old':   ["OLD\r", [["FILE NAME--$", 'name']]]
    'name':  ["HELLO.BA\r", [["READY\r\n$", 'run']]]
    'run':   ["RUN\r", [["WHAT\\'S YOUR NAME  \\?$", 'basic']]]
    'basic': ["\x03", [["READY\r\n$", 'quit']]]
    'quit':  ["\x03", [["\n\\.$", 'success']]]

'bunny':
    'start': ["R BASIC\r", [["NEW OR OLD--$", 'old']]]
    'old':   ["OLD\r", [["FILE NAME--$", 'name']]]
    'name':  ["BUNNY.BA\r", [["READY\r\n$", 'run']]]
    'run':   ["RUN\r", [
              ["^RUN$", 'kick'],
              [".*NY\r\n\r\nREADY\r\n$", 'quit']
             ]
    ]
    'kick':  ["\r", [
               [".*NY.*\r\n\r\nREADY\r\n|READY\r\n", 'quit'],
             ]
    ]
    'quit':  ["\x03", [["\n\\.$", 'success']]]

