From 64dcfcb070d5377137b366929d2ef1977eaae076 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 11 Dec 2014 11:11:18 -0800 Subject: [PATCH] Use hex literals --- test/test_execjs.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_execjs.rb b/test/test_execjs.rb index b10e39b..a9cac19 100644 --- a/test/test_execjs.rb +++ b/test/test_execjs.rb @@ -101,7 +101,7 @@ class TestExecJS < Test "\\", "café", "☃", - ["0ff98948"].pack("h*").force_encoding("UTF-8"), # Smiling emoji + "\xf0\x9f\x98\x84".force_encoding("UTF-8"), # Smiling emoji [1, 2, 3], [1, [2, 3]], [1, [2, [3]]], @@ -162,12 +162,12 @@ class TestExecJS < Test def test_surrogate_pairs # Smiling emoji - str = ["0ff98948"].pack("h*").force_encoding("UTF-8") + str = "\xf0\x9f\x98\x84".force_encoding("UTF-8") assert_equal 2, ExecJS.eval("'#{str}'.length") assert_equal str, ExecJS.eval("'#{str}'") # US flag emoji - str = ["0ff978ab0ff9788b"].pack("h*").force_encoding("UTF-8") + str = "\xf0\x9f\x87\xba\xf0\x9f\x87\xb8".force_encoding("UTF-8") assert_equal 4, ExecJS.eval("'#{str}'.length") assert_equal str, ExecJS.eval("'#{str}'") end