hy/tests/macros/test_tag_macros.py

18 lines
574 B
Python
Raw Normal View History

2019-02-07 14:57:35 +01:00
# Copyright 2019 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
from hy.macros import macroexpand
from hy.compiler import HyTypeError, HyASTCompiler
from hy.lex import tokenize
2017-06-21 05:48:54 +02:00
def test_tag_macro_error():
2015-12-08 14:43:47 +01:00
"""Check if we get correct error with wrong dispatch character"""
try:
2017-06-21 05:48:54 +02:00
macroexpand(tokenize("(dispatch_tag_macro '- '())")[0],
__name__,
HyASTCompiler(__name__))
except HyTypeError as e:
assert "with the character `-`" in str(e)