Add tests about token encoding (failing for now).
This commit is contained in:
parent
b16eab8f33
commit
8c653b519e
2 changed files with 15 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue