assert_nothing_raised { Biopieces.options_parse(argv,[],SCRIPT_PATH) }
end
-# # FIXME This one fails because any argument to a flag is ignored and the flag value is set to true. Should it raise?
-# test "Options.parse with type cast flag with and argument raises
-# casts = [{:long=>"foo", :short=>"f", :type=>"flag", :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}]
-# opt_parser = Options.new(casts)
-# assert_raise(ArgumentError) { opt_parser.parse(["--foo", "bar"],SCRIPT_PATH) }
-# end
-
def test_Biopieces_options_parse_with_stream_in_argv_returns_correct_options
argv = ["--stream_in", DUMMY_FILE]
options = Biopieces.options_parse(argv,[],SCRIPT_PATH)
assert_nothing_raised(ArgumentError) { Biopieces.options_parse(argv,casts,SCRIPT_PATH) }
end
-# # This one results in an error: "OptionParser::InvalidArgument: invalid argument: --foo bar"
-# # So it appears that this is tested in OptionParser already.
-# test "Options.parse with type cast int and non-int value raises" do
-# ["bar" ].each do |val| # what about nil, false, true, [], {}, 0.1 ?
-# casts = [{:long=>"foo", :short=>"f", :type=>"int", :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}]
-# opt_parser = Options.new(casts)
-# assert_raise(ArgumentError) { opt_parser.parse(["--foo", "#{val}"],SCRIPT_PATH) }
-# end
-# end
-
def test_Biopieces_options_parse_with_type_cast_int_dont_raise
[0,-1,1,327649123746293746374276347824].each do |val|
argv = ["--foo", "#{val}", "-I", DUMMY_FILE]
end
end
- # TODO similar test for uint as "test "Options.parse with type cast int and non-int value raises" do"
-
def test_Biopieces_options_parse_with_type_cast_uint_dont_raise
[0,1,327649123746293746374276347824].each do |val|
argv = ["--foo", "#{val}", "-I", DUMMY_FILE]