diff --git a/test/box/print.result b/test/box/print.result new file mode 100644 index 0000000000000000000000000000000000000000..addb4b842292c4d940c696c4c3b1501820da1a65 --- /dev/null +++ b/test/box/print.result @@ -0,0 +1,36 @@ +print("Hello, world") +--- +... +box.fiber.wrap(function() print("Hello, world") end) +--- +- null +... +box.fiber.sleep(0.1) +--- +... +Check log line +--- +- "line contains 'Hello'" +... +box.fiber.wrap(function() print("Ehllo, world") end) +--- +- null +... +box.fiber.sleep(0.1) +--- +... +Check log line +--- +- "line doesn't contain 'Hello'" +... +box.fiber.wrap(function() print() end) +--- +- null +... +box.fiber.sleep(0.1) +--- +... +Check log line +--- +- "line doesn't contain 'PPPPPPPP'" +... diff --git a/test/box/print.test.py b/test/box/print.test.py new file mode 100644 index 0000000000000000000000000000000000000000..16dc9f7cc34c622366873415e17ed4898b2d3dac --- /dev/null +++ b/test/box/print.test.py @@ -0,0 +1,43 @@ +import tarantool + +import sys +import os +import re + + +admin('print("Hello, world")') + +log = os.path.join(vardir, "tarantool.log") +f = open(log, "r") +f.seek(0, 2) + +admin('box.fiber.wrap(function() print("Hello, world") end)') +admin('box.fiber.sleep(0.1)') +line = f.readline() +print("Check log line") +print("---") +if re.search('(Hello)', line).start(1) > 0: + print("""- "line contains 'Hello'" """) + print("...") + +admin('box.fiber.wrap(function() print("Ehllo, world") end)') +admin('box.fiber.sleep(0.1)') +line = f.readline() +print("Check log line") +print("---") +if re.search('(Hello)', line): + print("""- "line contains 'Hello'" """) +else: + print("""- "line doesn't contain 'Hello'" """) +print("...") + +admin('box.fiber.wrap(function() print() end)') +admin('box.fiber.sleep(0.1)') +line = f.readline() +print("Check log line") +print("---") +if re.search('(PPPPPPPP)', line): + print("""- "line contains 'PPPPPPPP'" """) +else: + print("""- "line doesn't contain 'PPPPPPPP'" """) +print("...")