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.lex.machine import Machine
|
||||||
from hy.compiler import hy_compile
|
from hy.compiler import hy_compile
|
||||||
from hy.core import process
|
from hy.core import process
|
||||||
from hy.importer import compile_
|
from hy.importer import ast_compile
|
||||||
|
|
||||||
import hy.completer
|
import hy.completer
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class HyREPL(code.InteractiveConsole):
|
|||||||
_machine = Machine(Idle, 1, 0)
|
_machine = Machine(Idle, 1, 0)
|
||||||
try:
|
try:
|
||||||
_ast = hy_compile(tokens, root=ast.Interactive)
|
_ast = hy_compile(tokens, root=ast.Interactive)
|
||||||
code = compile_(_ast, filename, symbol)
|
code = ast_compile(_ast, filename, symbol)
|
||||||
except Exception:
|
except Exception:
|
||||||
self.showtraceback()
|
self.showtraceback()
|
||||||
return False
|
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…
x
Reference in New Issue
Block a user