2020-01-03 19:47:51 +01:00
|
|
|
# Copyright 2020 the authors.
|
2017-04-27 23:16:57 +02:00
|
|
|
# This file is part of Hy, which is free software licensed under the Expat
|
|
|
|
# license. See the LICENSE.
|
|
|
|
|
2013-12-15 17:47:24 +01:00
|
|
|
from hy.macros import macroexpand
|
2015-12-23 21:13:18 +01:00
|
|
|
from hy.compiler import HyTypeError, HyASTCompiler
|
2013-12-15 17:47:24 +01:00
|
|
|
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"""
|
2013-12-15 17:47:24 +01:00
|
|
|
try:
|
2017-06-21 05:48:54 +02:00
|
|
|
macroexpand(tokenize("(dispatch_tag_macro '- '())")[0],
|
2018-10-23 20:41:20 +02:00
|
|
|
__name__,
|
2015-12-23 21:13:18 +01:00
|
|
|
HyASTCompiler(__name__))
|
2013-12-15 17:47:24 +01:00
|
|
|
except HyTypeError as e:
|
|
|
|
assert "with the character `-`" in str(e)
|