summaryrefslogtreecommitdiff
path: root/test/optparse
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-24 01:56:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-24 01:56:04 +0000
commit3fe5d355a802d3212651a42eb6c54129cbf89b21 (patch)
treeb9de5e17892d4a69acfe115f2ec3f93da03acaf8 /test/optparse
parentbb52d2be4080e8cd6f1633c7fe8339b0ccced566 (diff)
optparse.rb: case-sensitive candidate
* lib/optparse.rb (candidate): short options are case-sensitive by the default, should not match case-different options.. https://github.com/mernen/completion-ruby/pull/9#issuecomment-317287946 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/optparse')
-rw-r--r--test/optparse/test_bash_completion.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/optparse/test_bash_completion.rb b/test/optparse/test_bash_completion.rb
index 714fd35cff..513e986f66 100644
--- a/test/optparse/test_bash_completion.rb
+++ b/test/optparse/test_bash_completion.rb
@@ -40,4 +40,9 @@ class TestOptionParser::BashCompletion < Test::Unit::TestCase
def test_long_for_option_complete
assert_equal(%w[hello help], @opt.candidate("--for=h"))
end
+
+ def test_case_sensitive
+ @opt.define("-Z") {}
+ assert_equal(%w[-z], @opt.candidate("-z"))
+ end
end