flag, tests: inline a few consts (#22174)

This commit is contained in:
larpon 2024-09-07 17:21:03 +02:00 committed by GitHub
parent 620e064110
commit 625e4df49a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,8 +7,6 @@ const exe_and_v_flag_parser_args_with_tail = ['/path/to/exe', '--version', '-p',
'--test', 'abc', '--done', '-p', 'two', '--live', 'run', '/path/to', 'platforms;android-21'] '--test', 'abc', '--done', '-p', 'two', '--live', 'run', '/path/to', 'platforms;android-21']
const error_wrong_assignment_flags = ['--o=error'] const error_wrong_assignment_flags = ['--o=error']
const exe_and_v_flag_parser_help_short_arg = ['/path/to/exe', '-h']
struct Prefs { struct Prefs {
version bool @[short: v] version bool @[short: v]
is_live bool @[long: live] is_live bool @[long: live]
@ -95,7 +93,7 @@ fn test_long_v_style_with_tail_no_exe() {
} }
fn test_long_v_style_with_exe_and_short_alias() { fn test_long_v_style_with_exe_and_short_alias() {
prefs, _ := flag.to_struct[Prefs](exe_and_v_flag_parser_help_short_arg, prefs, _ := flag.to_struct[Prefs](['/path/to/exe', '-h'],
skip: 1 skip: 1
style: .v_flag_parser style: .v_flag_parser
)! )!