Add tests about token encoding (failing for now).

This commit is contained in:
Jakob Rath 2013-12-16 21:28:23 +01:00 committed by Dan Hirsch
parent b16eab8f33
commit 8c653b519e
2 changed files with 15 additions and 2 deletions

View file

@ -80,4 +80,14 @@ class ParserTest < Minitest::Test
refute_nil parser.parse('今日a')
end
def test_token_encoding(encoding='UTF-8')
string = '今日'.encode(encoding)
parser = Hammer::Parser.token(string)
assert_equal string, parser.parse(string)[:ast][:data][:bytes].token
end
def test_token_encoding_2
test_token_encoding('EUC-JP')
end
end