hy/tests/macros/test_sharp_macros.py

13 lines
414 B
Python
Raw Normal View History

from hy.macros import macroexpand
from hy.compiler import HyTypeError, HyASTCompiler
from hy.lex import tokenize
def test_sharp_macro_error():
2015-12-08 14:43:47 +01:00
"""Check if we get correct error with wrong dispatch character"""
try:
macroexpand(tokenize("(dispatch_sharp_macro '- '())")[0],
HyASTCompiler(__name__))
except HyTypeError as e:
assert "with the character `-`" in str(e)