Fix bin/hy and add a unit test
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7f230fdd10
commit
3226ecc33f
4
bin/hy
4
bin/hy
@ -21,7 +21,7 @@ from hy.lex.states import Idle, LexException
|
||||
from hy.lex.machine import Machine
|
||||
from hy.compiler import hy_compile
|
||||
from hy.core import process
|
||||
from hy.importer import compile_
|
||||
from hy.importer import ast_compile
|
||||
|
||||
import hy.completer
|
||||
|
||||
@ -59,7 +59,7 @@ class HyREPL(code.InteractiveConsole):
|
||||
_machine = Machine(Idle, 1, 0)
|
||||
try:
|
||||
_ast = hy_compile(tokens, root=ast.Interactive)
|
||||
code = compile_(_ast, filename, symbol)
|
||||
code = ast_compile(_ast, filename, symbol)
|
||||
except Exception:
|
||||
self.showtraceback()
|
||||
return False
|
||||
|
8
tests/test_bin.py
Normal file
8
tests/test_bin.py
Normal file
@ -0,0 +1,8 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
def test_bin_hy():
|
||||
p = subprocess.Popen("echo | bin/hy",
|
||||
shell=True)
|
||||
p.wait()
|
||||
assert p.returncode == 0
|
Loading…
Reference in New Issue
Block a user