Skip to content

Commit

Permalink
Merge pull request #180 from aycabta/use-startup_message-option-inste…
Browse files Browse the repository at this point in the history
…ad-of-startup-wait

Use startup_option instead of startup wait
  • Loading branch information
aycabta authored Oct 9, 2020
2 parents 32b51c9 + a63ce63 commit a8bbb4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
1 change: 1 addition & 0 deletions reline.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'test-unit'
spec.add_development_dependency 'yamatanooroti', '>= 0.0.5'
end
36 changes: 12 additions & 24 deletions test/reline/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def teardown
end

def test_history_back
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write(":a\n")
write("\C-p")
close
Expand All @@ -40,8 +39,7 @@ def test_history_back
end

def test_backspace
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write(":abc\C-h\n")
close
assert_screen(<<~EOC)
Expand All @@ -53,8 +51,7 @@ def test_backspace
end

def test_autowrap
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write('01234567890123456789012')
close
assert_screen(<<~EOC)
Expand All @@ -65,8 +62,7 @@ def test_autowrap
end

def test_finish_autowrapped_line
start_terminal(10, 40, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(10, 40, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write("[{'user'=>{'email'=>'a@a', 'id'=>'ABC'}, 'version'=>4, 'status'=>'succeeded'}]\n")
close
assert_screen(<<~EOC)
Expand All @@ -82,8 +78,7 @@ def test_finish_autowrapped_line
end

def test_finish_autowrapped_line_in_the_middle_of_lines
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(20, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write("[{'user'=>{'email'=>'abcdef@abcdef', 'id'=>'ABC'}, 'version'=>4, 'status'=>'succeeded'}]#{"\C-b"*7}\n")
close
assert_screen(<<~EOC)
Expand All @@ -101,8 +96,7 @@ def test_finish_autowrapped_line_in_the_middle_of_lines
end

def test_finish_autowrapped_line_in_the_middle_of_multilines
start_terminal(30, 16, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(30, 16, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write("<<~EOM\n ABCDEFG\nEOM\n")
close
assert_screen(<<~'EOC')
Expand All @@ -120,8 +114,7 @@ def test_prompt
write_inputrc <<~'LINES'
"abc": "123"
LINES
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write("abc\n")
close
assert_screen(<<~EOC)
Expand All @@ -136,8 +129,7 @@ def test_mode_icon_emacs
write_inputrc <<~LINES
set show-mode-in-prompt on
LINES
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
close
assert_screen(<<~EOC)
Multiline REPL.
Expand All @@ -150,8 +142,7 @@ def test_mode_icon_vi
set editing-mode vi
set show-mode-in-prompt on
LINES
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write(":a\n\C-[k")
close
assert_screen(<<~EOC)
Expand All @@ -167,8 +158,7 @@ def test_original_mode_icon_emacs
set show-mode-in-prompt on
set emacs-mode-string [emacs]
LINES
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
close
assert_screen(<<~EOC)
Multiline REPL.
Expand All @@ -181,8 +171,7 @@ def test_original_mode_icon_with_quote
set show-mode-in-prompt on
set emacs-mode-string "[emacs]"
LINES
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
close
assert_screen(<<~EOC)
Multiline REPL.
Expand All @@ -197,8 +186,7 @@ def test_original_mode_icon_vi
set vi-ins-mode-string "{InS}"
set vi-cmd-mode-string "{CmD}"
LINES
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl})
sleep 0.5
start_terminal(5, 30, %W{ruby -I#{@pwd}/lib #{@pwd}/bin/multiline_repl}, startup_message: 'Multiline REPL.')
write(":a\n\C-[k")
close
assert_screen(<<~EOC)
Expand Down

0 comments on commit a8bbb4e

Please sign in to comment.