Skip to content

Commit 55a3aa1

Browse files
lucasoshirogitster
authored andcommitted
t1901: use tr in git repo structure output instead of expected value
The test 'keyvalue and nul format', as it description says, test both keyvalue and nul format. These formats are similar, differing only in their field separator (= in the former, LF in the latter) and their record separator (LF in the former, NUL in the latter). This way, both formats can be tested using the same expected output and only replacing the separators in one of the output formats. Adjust the output of `git repo structure --format=nul` in t1901, matching the --format=keyvalue ones. Compare this output against the same value expected from --format=keyvalue. Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3726d56 commit 55a3aa1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

t/t1901-repo-structure.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,18 @@ test_expect_success SHA1 'lines and nul format' '
145145
test_cmp expect out &&
146146
test_line_count = 0 err &&
147147
148-
# Replace key and value delimiters for nul format.
149-
tr "\n=" "\0\n" <expect >expect_nul &&
150148
git repo structure --format=nul >out 2>err &&
149+
tr "\012" "=" <out | tr "\000" "\012" >actual &&
151150
152-
test_cmp expect_nul out &&
151+
test_cmp expect actual &&
153152
test_line_count = 0 err &&
154153
155154
# "-z", as a synonym to "--format=nul", participates in the
156155
# usual "last one wins" rule.
157156
git repo structure --format=table -z >out 2>err &&
157+
tr "\012" "=" <out | tr "\000" "\012" >actual &&
158158
159-
test_cmp expect_nul out &&
159+
test_cmp expect actual &&
160160
test_line_count = 0 err
161161
)
162162
'

0 commit comments

Comments
 (0)