Skip to content

Commit bb9316d

Browse files
committed
t: cover flux-jobs expandable field headers
Problem: Tests already exist for flux-jobs expandable fields ("+:") but do not cover the special case when all outputs are less than the length of the column header. Add a test in t2800-jobs-cmd.t.
1 parent c81bb9a commit bb9316d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/t2800-jobs-cmd.t

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ test_expect_success 'flux-jobs: specified width overrides expandable field' '
209209
test_debug "cat expanded2.out" &&
210210
grep "^ nosuchcommand" expanded2.out
211211
'
212+
# N.B. if header was not accounted for, the job name "a" would not be
213+
# right aligned by three spaces (header is "NAME")
214+
test_expect_success 'flux-jobs: header accounted for in expandable field' '
215+
echo "{\"id\":195823665152,\"state\":8,\"name\":\"a\"}" \
216+
| flux jobs --from-stdin -o "+:{name:>1}" > expanded3.out &&
217+
grep "^ a" expanded3.out
218+
'
219+
test_expect_success 'flux-jobs: header not accounted for in expandable field if no header output' '
220+
echo "{\"id\":195823665152,\"state\":8,\"name\":\"a\"}" \
221+
| flux jobs --from-stdin -no "+:{name:>1}" > expanded3.out &&
222+
grep "^a" expanded3.out
223+
'
212224
test_expect_success 'flux-jobs: collapsible+expandable fields work' '
213225
flux jobs -ao "{id.f58:<12} ?+:{exception.type:>1}" >both.out &&
214226
flux jobs -f running,completed \

0 commit comments

Comments
 (0)