[MacRuby] #860: Assertion fails when MacRuby should throw an exception of "OptionParser::AmbiguousOption".

MacRuby ruby-noreply at macosforge.org
Thu Aug 19 23:46:44 PDT 2010


#860: Assertion fails when MacRuby should throw an exception of
"OptionParser::AmbiguousOption".
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 $ cat test_opt.rb
 require 'optparse'

 opt = OptionParser.new
 flag = self.class

 opt.def_option("--open") {|x|}
 opt.def_option("-x") {|x| flag = x}
 opt.def_option("--option") {|x| flag = x}

 begin
   opt.parse!(%w"--op")
 rescue => e
   p e
 end

 begin
   opt.parse!(%w"-o")
 rescue => e
   p e
 end
 }}}

 Result of Ruby 1.9.1:
 {{{
 $ ruby test_opt.rb
 #<OptionParser::AmbiguousOption: --op>
 #<OptionParser::AmbiguousOption: -o>
 }}}

 Result of MacRuby Trunk:
 {{{
 $ macruby test_opt.rb
 #<OptionParser::AmbiguousOption: --op>
 Assertion failed: ((size_t)pos < current_exceptions.size()), function
 pop_current_exception, file vm.cpp, line 3343.
 zsh: abort      macruby test_opt.rb
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/860>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list