Skip to content

Commit

Permalink
cli remove redundant flag tests*
Browse files Browse the repository at this point in the history
*check with tests above:
the tests don't test any other/new functionality just include private fields.
  • Loading branch information
ttytm committed Apr 5, 2024
1 parent 74c356e commit a6c3371
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions vlib/cli/flag_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ fn test_if_string_flag_parses() {
flag.parse(['-flag=value2'], false) or { panic(err) }
mut values := flag.get_strings() or { panic(err) }
assert values == ['value1', 'value2']

flags := [
cli.Flag{
flag: .string_array
name: 'flag'
value: ['a', 'b', 'c']
},
cli.Flag{
flag: .string
name: 'flag2'
},
]

values = flags.get_strings('flag') or { panic(err) }
assert values == ['a', 'b', 'c']
}

fn test_if_bool_flag_parses() {
Expand Down Expand Up @@ -94,21 +79,6 @@ fn test_if_int_flag_parses() {
flag.parse(['-flag=45'], false) or { panic(err) }
mut values := flag.get_ints() or { panic(err) }
assert values == [42, 45]

flags := [
cli.Flag{
flag: .int_array
name: 'flag'
value: ['1', '2', '3']
},
cli.Flag{
flag: .int
name: 'flag2'
},
]

values = flags.get_ints('flag') or { panic(err) }
assert values == [1, 2, 3]
}

fn test_if_float_flag_parses() {
Expand Down Expand Up @@ -139,21 +109,6 @@ fn test_if_float_flag_parses() {
flag.parse(['-flag=1.3'], false) or { panic(err) }
mut values := flag.get_floats() or { panic(err) }
assert values == [3.1, 1.3]

flags := [
cli.Flag{
flag: .float_array
name: 'flag'
value: ['1.1', '2.2', '3.3']
},
cli.Flag{
flag: .float
name: 'flag2'
},
]

values = flags.get_floats('flag') or { panic(err) }
assert values == [1.1, 2.2, 3.3]
}

fn test_if_flag_parses_with_abbrev() {
Expand Down

0 comments on commit a6c3371

Please sign in to comment.