Add repl functions "help" and "exit" (#1563)

This commit is contained in:
Sergey Golovin 2019-01-29 22:41:12 +03:00 committed by Ryan Dahl
parent 457e65bc2f
commit 240ca25617
2 changed files with 31 additions and 6 deletions

View file

@ -56,11 +56,22 @@ class Repl(object):
assertEqual(code, 0)
def test_exit_command(self):
out, err, code = self.input(".exit", "'ignored'", exit=False)
out, err, code = self.input("exit", "'ignored'", exit=False)
assertEqual(out, '')
assertEqual(err, '')
assertEqual(code, 0)
def test_help_command(self):
out, err, code = self.input("help")
expectedOut = '\n'.join([
"exit Exit the REPL",
"help Print this help message",
"",
])
assertEqual(out, expectedOut)
assertEqual(err, '')
assertEqual(code, 0)
def test_function(self):
out, err, code = self.input("deno.writeFileSync")
assertEqual(out, '[Function: writeFileSync]\n')