Permalink
Browse files

Merge pull request #100 from os97673/var-instance-command-regexp

Var instance command regexp
  • Loading branch information...
2 parents 5c714da + e2b976d commit 362775b728d4960729ed1ff809e5f965c2e9e51a @cldwalker committed Sep 23, 2013
Showing with 13 additions and 1 deletion.
  1. +1 −1 lib/ruby-debug/commands/variables.rb
  2. +12 −0 test/variables_test.rb
@@ -110,7 +110,7 @@ def help(cmd)
class VarInstanceCommand < Command # :nodoc:
def regexp
# id will be read as first match, name as post match
- /^\s*v(?:ar)?\s+ins(?:tance)?\s*((?:[\\+-]0x)[\dabcdef]+)?/
+ /^\s*v(?:ar)?\s+i(?:ns(?:tance)?)?\s*(?:((?:[\\+-]0x)[\dabcdef]+)|\s|$)/
end
def execute
View
@@ -83,6 +83,18 @@
check_output_includes /@inst_a = 1\n@inst_b = 2/
end
+ it "must not accept 'v insv' as shortcut for 'v ins v'" do
+ enter 'break 25', 'cont', 'v insv'
+ debug_file 'variables'
+ check_output_doesnt_include /@inst_a = 1\n@inst_b = 2/
+ end
+
+ it "must be able to use i as a shortcut" do
+ enter 'break 25', 'cont', 'v i v'
+ debug_file 'variables'
+ check_output_includes /@inst_a = 1\n@inst_b = 2/
+ end
+
it "must cut long variable values according to :width setting" do
temporary_change_hash_value(Debugger::Command.settings, :width, 20) do
enter 'break 25', 'cont', 'var instance v'

0 comments on commit 362775b

Please sign in to comment.