summaryrefslogtreecommitdiff
path: root/test/reline/test_key_actor_emacs.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-06-25 16:29:55 +0900
committeraycabta <aycabta@gmail.com>2021-06-25 17:42:45 +0900
commit9103c3ba8bc09f287f69ca322f58faa34e003f2e (patch)
treeb081a09de4aaa2797c7964bd4fcd2b50cef76ea0 /test/reline/test_key_actor_emacs.rb
parentbf376cae0c308f738bb255d110ac7c85019515cb (diff)
downloadruby-9103c3ba8bc09f287f69ca322f58faa34e003f2e.tar.gz
Revert "[ruby/reline] Fix failed test"
This reverts commit 491591c7cee842601118efc2698e0e41283827b3.
Diffstat (limited to 'test/reline/test_key_actor_emacs.rb')
-rw-r--r--test/reline/test_key_actor_emacs.rb118
1 files changed, 59 insertions, 59 deletions
diff --git a/test/reline/test_key_actor_emacs.rb b/test/reline/test_key_actor_emacs.rb
index 77585cb690..c45961ac35 100644
--- a/test/reline/test_key_actor_emacs.rb
+++ b/test/reline/test_key_actor_emacs.rb
@@ -2140,65 +2140,65 @@ class Reline::KeyActor::Emacs::Test < Reline::TestCase
end
# Unicode emoji test
- def test_ed_insert_for_include_zwj_emoji
- return if Reline::IOGate.encoding != Encoding::UTF_8
- # U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466 is family: man, woman, girl, boy "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"
- input_keys("\u{1F468}") # U+1F468 is man "๐Ÿ‘จ"
- assert_line("\u{1F468}")
- assert_byte_pointer_size("\u{1F468}")
- assert_cursor(2)
- assert_cursor_max(2)
- input_keys("\u200D") # U+200D is ZERO WIDTH JOINER
- assert_line("\u{1F468 200D}")
- assert_byte_pointer_size("\u{1F468 200D}")
- assert_cursor(2)
- assert_cursor_max(2)
- input_keys("\u{1F469}") # U+1F469 is woman "๐Ÿ‘ฉ"
- assert_line("\u{1F468 200D 1F469}")
- assert_byte_pointer_size("\u{1F468 200D 1F469}")
- assert_cursor(2)
- assert_cursor_max(2)
- input_keys("\u200D") # U+200D is ZERO WIDTH JOINER
- assert_line("\u{1F468 200D 1F469 200D}")
- assert_byte_pointer_size("\u{1F468 200D 1F469 200D}")
- assert_cursor(2)
- assert_cursor_max(2)
- input_keys("\u{1F467}") # U+1F467 is girl "๐Ÿ‘ง"
- assert_line("\u{1F468 200D 1F469 200D 1F467}")
- assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467}")
- assert_cursor(2)
- assert_cursor_max(2)
- input_keys("\u200D") # U+200D is ZERO WIDTH JOINER
- assert_line("\u{1F468 200D 1F469 200D 1F467 200D}")
- assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467 200D}")
- assert_cursor(2)
- assert_cursor_max(2)
- input_keys("\u{1F466}") # U+1F466 is boy "๐Ÿ‘ฆ"
- assert_line("\u{1F468 200D 1F469 200D 1F467 200D 1F466}")
- assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467 200D 1F466}")
- assert_cursor(2)
- assert_cursor_max(2)
- # U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466 is family: man, woman, girl, boy "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"
- input_keys("\u{1F468 200D 1F469 200D 1F467 200D 1F466}")
- assert_line("\u{1F468 200D 1F469 200D 1F467 200D 1F466 1F468 200D 1F469 200D 1F467 200D 1F466}")
- assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467 200D 1F466 1F468 200D 1F469 200D 1F467 200D 1F466}")
- assert_cursor(4)
- assert_cursor_max(4)
- end
-
- def test_ed_insert_for_include_valiation_selector
- return if Reline::IOGate.encoding != Encoding::UTF_8
- # U+0030 U+FE00 is DIGIT ZERO + VARIATION SELECTOR-1 "0๏ธ€"
- input_keys("\u0030") # U+0030 is DIGIT ZERO
- assert_line("\u0030")
- assert_byte_pointer_size("\u0030")
- assert_cursor(1)
- assert_cursor_max(1)
- input_keys("\uFE00") # U+FE00 is VARIATION SELECTOR-1
- assert_line("\u{0030 FE00}")
- assert_byte_pointer_size("\u{0030 FE00}")
- assert_cursor(1)
- assert_cursor_max(1)
+ if Reline::IOGate.encoding == Encoding::UTF_8
+ def test_ed_insert_for_include_zwj_emoji
+ # U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466 is family: man, woman, girl, boy "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"
+ input_keys("\u{1F468}") # U+1F468 is man "๐Ÿ‘จ"
+ assert_line("\u{1F468}")
+ assert_byte_pointer_size("\u{1F468}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ input_keys("\u200D") # U+200D is ZERO WIDTH JOINER
+ assert_line("\u{1F468 200D}")
+ assert_byte_pointer_size("\u{1F468 200D}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ input_keys("\u{1F469}") # U+1F469 is woman "๐Ÿ‘ฉ"
+ assert_line("\u{1F468 200D 1F469}")
+ assert_byte_pointer_size("\u{1F468 200D 1F469}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ input_keys("\u200D") # U+200D is ZERO WIDTH JOINER
+ assert_line("\u{1F468 200D 1F469 200D}")
+ assert_byte_pointer_size("\u{1F468 200D 1F469 200D}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ input_keys("\u{1F467}") # U+1F467 is girl "๐Ÿ‘ง"
+ assert_line("\u{1F468 200D 1F469 200D 1F467}")
+ assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ input_keys("\u200D") # U+200D is ZERO WIDTH JOINER
+ assert_line("\u{1F468 200D 1F469 200D 1F467 200D}")
+ assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467 200D}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ input_keys("\u{1F466}") # U+1F466 is boy "๐Ÿ‘ฆ"
+ assert_line("\u{1F468 200D 1F469 200D 1F467 200D 1F466}")
+ assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467 200D 1F466}")
+ assert_cursor(2)
+ assert_cursor_max(2)
+ # U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466 is family: man, woman, girl, boy "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"
+ input_keys("\u{1F468 200D 1F469 200D 1F467 200D 1F466}")
+ assert_line("\u{1F468 200D 1F469 200D 1F467 200D 1F466 1F468 200D 1F469 200D 1F467 200D 1F466}")
+ assert_byte_pointer_size("\u{1F468 200D 1F469 200D 1F467 200D 1F466 1F468 200D 1F469 200D 1F467 200D 1F466}")
+ assert_cursor(4)
+ assert_cursor_max(4)
+ end
+
+ def test_ed_insert_for_include_valiation_selector
+ # U+0030 U+FE00 is DIGIT ZERO + VARIATION SELECTOR-1 "0๏ธ€"
+ input_keys("\u0030") # U+0030 is DIGIT ZERO
+ assert_line("\u0030")
+ assert_byte_pointer_size("\u0030")
+ assert_cursor(1)
+ assert_cursor_max(1)
+ input_keys("\uFE00") # U+FE00 is VARIATION SELECTOR-1
+ assert_line("\u{0030 FE00}")
+ assert_byte_pointer_size("\u{0030 FE00}")
+ assert_cursor(1)
+ assert_cursor_max(1)
+ end
end
def test_em_yank_pop