@@ -23,7 +23,7 @@ usage: test-tool parse-options <options>
2323 -i, --[no-]integer <n>
2424 get a integer
2525 -j <n> get a integer, too
26- -m , --magnitude <n> get a magnitude
26+ -u , --unsigned <n> get an unsigned integer
2727 --[no-]set23 set integer to 23
2828 --mode1 set integer to 1 (cmdmode option)
2929 --mode2 set integer to 2 (cmdmode option)
@@ -115,30 +115,30 @@ test_expect_success 'OPT_INTEGER() negative' 'check integer: -2345 -i -2345'
115115test_expect_success ' OPT_INTEGER() kilo' ' check integer: 239616 -i 234k'
116116test_expect_success ' OPT_INTEGER() negative kilo' ' check integer: -239616 -i -234k'
117117
118- test_expect_success ' OPT_MAGNITUDE () simple' '
119- check magnitude : 2345678 -m 2345678
118+ test_expect_success ' OPT_UNSIGNED () simple' '
119+ check unsigned : 2345678 -u 2345678
120120'
121121
122- test_expect_success ' OPT_MAGNITUDE () kilo' '
123- check magnitude : 239616 -m 234k
122+ test_expect_success ' OPT_UNSIGNED () kilo' '
123+ check unsigned : 239616 -u 234k
124124'
125125
126- test_expect_success ' OPT_MAGNITUDE () mega' '
127- check magnitude : 104857600 -m 100m
126+ test_expect_success ' OPT_UNSIGNED () mega' '
127+ check unsigned : 104857600 -u 100m
128128'
129129
130- test_expect_success ' OPT_MAGNITUDE () giga' '
131- check magnitude : 1073741824 -m 1g
130+ test_expect_success ' OPT_UNSIGNED () giga' '
131+ check unsigned : 1073741824 -u 1g
132132'
133133
134- test_expect_success ' OPT_MAGNITUDE () 3giga' '
135- check magnitude : 3221225472 -m 3g
134+ test_expect_success ' OPT_UNSIGNED () 3giga' '
135+ check unsigned : 3221225472 -u 3g
136136'
137137
138138cat > expect << \EOF
139139boolean: 2
140140integer: 1729
141- magnitude : 16384
141+ unsigned : 16384
142142timestamp: 0
143143string: 123
144144abbrev: 7
@@ -149,7 +149,7 @@ file: prefix/my.file
149149EOF
150150
151151test_expect_success ' short options' '
152- test-tool parse-options -s123 -b -i 1729 -m 16k -b -vv -n -F my.file \
152+ test-tool parse-options -s123 -b -i 1729 -u 16k -b -vv -n -F my.file \
153153 >output 2>output.err &&
154154 test_cmp expect output &&
155155 test_must_be_empty output.err
@@ -158,7 +158,7 @@ test_expect_success 'short options' '
158158cat > expect << \EOF
159159boolean: 2
160160integer: 1729
161- magnitude : 16384
161+ unsigned : 16384
162162timestamp: 0
163163string: 321
164164abbrev: 10
@@ -169,7 +169,7 @@ file: prefix/fi.le
169169EOF
170170
171171test_expect_success ' long options' '
172- test-tool parse-options --boolean --integer 1729 --magnitude 16k \
172+ test-tool parse-options --boolean --integer 1729 --unsigned 16k \
173173 --boolean --string2=321 --verbose --verbose --no-dry-run \
174174 --abbrev=10 --file fi.le --obsolete \
175175 >output 2>output.err &&
@@ -181,7 +181,7 @@ test_expect_success 'abbreviate to something longer than SHA1 length' '
181181 cat >expect <<-EOF &&
182182 boolean: 0
183183 integer: 0
184- magnitude : 0
184+ unsigned : 0
185185 timestamp: 0
186186 string: (not set)
187187 abbrev: 100
@@ -255,7 +255,7 @@ test_expect_success 'superfluous value provided: cmdmode' '
255255cat > expect << \EOF
256256boolean: 1
257257integer: 13
258- magnitude : 0
258+ unsigned : 0
259259timestamp: 0
260260string: 123
261261abbrev: 7
@@ -278,7 +278,7 @@ test_expect_success 'intermingled arguments' '
278278cat > expect << \EOF
279279boolean: 0
280280integer: 2
281- magnitude : 0
281+ unsigned : 0
282282timestamp: 0
283283string: (not set)
284284abbrev: 7
@@ -345,7 +345,7 @@ cat >expect <<\EOF
345345Callback: "four", 0
346346boolean: 5
347347integer: 4
348- magnitude : 0
348+ unsigned : 0
349349timestamp: 0
350350string: (not set)
351351abbrev: 7
@@ -370,7 +370,7 @@ test_expect_success 'OPT_CALLBACK() and callback errors work' '
370370cat > expect << \EOF
371371boolean: 1
372372integer: 23
373- magnitude : 0
373+ unsigned : 0
374374timestamp: 0
375375string: (not set)
376376abbrev: 7
@@ -449,7 +449,7 @@ test_expect_success 'OPT_NUMBER_CALLBACK() works' '
449449cat > expect << \EOF
450450boolean: 0
451451integer: 0
452- magnitude : 0
452+ unsigned : 0
453453timestamp: 0
454454string: (not set)
455455abbrev: 7
@@ -773,14 +773,14 @@ test_expect_success 'subcommands are incompatible with KEEP_DASHDASH unless in c
773773 grep ^BUG err
774774'
775775
776- test_expect_success ' negative magnitude ' '
777- test_must_fail test-tool parse-options --magnitude -1 >out 2>err &&
776+ test_expect_success ' negative unsigned ' '
777+ test_must_fail test-tool parse-options --unsigned -1 >out 2>err &&
778778 grep "non-negative integer" err &&
779779 test_must_be_empty out
780780'
781781
782- test_expect_success ' magnitude with units but no numbers' '
783- test_must_fail test-tool parse-options --magnitude m >out 2>err &&
782+ test_expect_success ' unsigned with units but no numbers' '
783+ test_must_fail test-tool parse-options --unsigned m >out 2>err &&
784784 grep "non-negative integer" err &&
785785 test_must_be_empty out
786786'
0 commit comments