Add tests for #533

This commit is contained in:
Kodi Arfer 2017-03-30 16:10:34 -07:00
parent f8e5645c2e
commit a7085138f6
2 changed files with 18 additions and 0 deletions

1
NEWS
View File

@ -21,6 +21,7 @@ Changes from 0.12.1
* A `yield` inside of a `with` statement will properly suppress implicit
returns.
* `setv` no longer unnecessarily tries to get attributes
* The REPL now prints the correct value of `do` and `try` forms
[ Misc. Improvements ]
* New contrib module `hy-repr`

View File

@ -114,6 +114,23 @@ def test_bin_hy_stdin_error_underline_alignment():
assert "\n (mabcdefghi)\n ^----------^" in err
def test_bin_hy_stdin_except_do():
# https://github.com/hylang/hy/issues/533
output, _ = run_cmd("hy", '(try (/ 1 0) (except [ZeroDivisionError] "hello"))') # noqa
assert "hello" in output
output, _ = run_cmd("hy", '(try (/ 1 0) (except [ZeroDivisionError] "aaa" "bbb" "ccc"))') # noqa
assert "aaa" not in output
assert "bbb" not in output
assert "ccc" in output
output, _ = run_cmd("hy", '(if True (do "xxx" "yyy" "zzz"))')
assert "xxx" not in output
assert "yyy" not in output
assert "zzz" in output
def test_bin_hy_stdin_hy_repr():
output, _ = run_cmd("hy", '(+ [1] [2])')
assert "[1, 2]" in output.replace('L', '')