mirror of
https://github.com/rails/execjs
synced 2023-03-27 23:21:20 -04:00
Just encode
This commit is contained in:
parent
c09b116d84
commit
8bca9cf4c8
1 changed files with 3 additions and 3 deletions
|
@ -101,8 +101,8 @@ class TestExecJS < Test
|
||||||
"\\",
|
"\\",
|
||||||
"café",
|
"café",
|
||||||
"☃",
|
"☃",
|
||||||
"\u{1f604}".force_encoding("UTF-8"), # Smiling emoji
|
"\u{1f604}".encode("UTF-8"), # Smiling emoji
|
||||||
"\u{1f1fa}\u{1f1f8}".force_encoding("UTF-8"), # US flag
|
"\u{1f1fa}\u{1f1f8}".encode("UTF-8"), # US flag
|
||||||
[1, 2, 3],
|
[1, 2, 3],
|
||||||
[1, [2, 3]],
|
[1, [2, 3]],
|
||||||
[1, [2, [3]]],
|
[1, [2, [3]]],
|
||||||
|
@ -168,7 +168,7 @@ class TestExecJS < Test
|
||||||
assert_equal str, ExecJS.eval("'#{str}'")
|
assert_equal str, ExecJS.eval("'#{str}'")
|
||||||
|
|
||||||
# US flag emoji
|
# US flag emoji
|
||||||
str = "\u{1f1fa}\u{1f1f8}".force_encoding("UTF-8")
|
str = "\u{1f1fa}\u{1f1f8}".encode("UTF-8")
|
||||||
assert_equal 4, ExecJS.eval("'#{str}'.length")
|
assert_equal 4, ExecJS.eval("'#{str}'.length")
|
||||||
assert_equal str, ExecJS.eval("'#{str}'")
|
assert_equal str, ExecJS.eval("'#{str}'")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue