Permalink
Browse files

Complete on lower-case signal name and 'unconditionally'.

  • Loading branch information...
rocky committed Sep 23, 2011
1 parent 38ca281 commit d3be40cf89706c6b0ef91761d7c475901f4450fd
Showing with 14 additions and 6 deletions.
  1. +3 −2 processor/command/kill.rb
  2. +11 −4 test/unit/test-cmd-kill.rb
@@ -35,9 +35,10 @@ class Trepan::Command::KillCommand < Trepan::Command
end
def complete(prefix)
completions = Signal.list.keys +
completions = Signal.list.keys + Signal.list.keys.map{|k| k.downcase} +
Signal.list.values.map{|i| i.to_s} +
Signal.list.values.map{|i| (-i).to_s}
Signal.list.values.map{|i| (-i).to_s} +
['unconditionally']
Trepan::Complete.complete_token(completions, prefix)
end
View
@@ -23,10 +23,17 @@ def reset_cmdproc_vars
end
def test_kill_command
@cmd.run([@name, 'foo'])
assert_equal(false, @cmd.proc.leave_cmd_loop)
assert_equal(1, @cmd.instance_variable_get('@errmsgs').size)
assert_equal(['unconditionally'], @cmd.complete('uncon'))
if Signal.list.member?('HUP')
assert_equal(['hup'], @cmd.complete('hu'))
assert_equal(['HUP'], @cmd.complete('HU'))
end
@cmd.run([@name, 'foo'])
assert_equal(false, @cmd.proc.leave_cmd_loop)
assert_equal(1, @cmd.instance_variable_get('@errmsgs').size)
if false
save_trap = Signal.trap(10) {
@success = true

0 comments on commit d3be40c

Please sign in to comment.