hy/tests/macros/test_sharp_macros.py
Kodi Arfer 4c38e2c9dd Rename reader macros to "sharp macros" (#1282)
They're not actually reader macros, since their arguments are parsed s-expressions, like a regular macro, not pre-parsed source text.
2017-04-21 10:07:48 -05:00

13 lines
414 B
Python

from hy.macros import macroexpand
from hy.compiler import HyTypeError, HyASTCompiler
from hy.lex import tokenize
def test_sharp_macro_error():
"""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)