Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Look for the old and new lines in one loop
-rwxr-xr-xtests/t0107-diff.sh15
1 file changed, 4 insertions, 11 deletions
diff --git a/tests/t0107-diff.sh b/tests/t0107-diff.sh
index a3948df..57632fa 100755
--- a/tests/t0107-diff.sh
+++ b/tests/t0107-diff.sh
@@ -93,22 +93,15 @@ test_expect_success 'every changed pair gets both a del and an add span' '
test_expect_success 'stripping the highlight leaves every line intact' '
sed -e "s/<[^>]*>//g" tmp >plain.out &&
- git -C repos/lcs show HEAD~1:lines.txt >old.txt &&
- git -C repos/lcs show HEAD:lines.txt >new.txt &&
+ git -C repos/lcs show HEAD~1:lines.txt >lines &&
+ git -C repos/lcs show HEAD:lines.txt >>lines &&
while read -r line
do
grep -qF "$line" plain.out || {
- echo "missing old line: $line"
+ echo "missing line: $line"
return 1
}
- done <old.txt &&
- while read -r line
- do
- grep -qF "$line" plain.out || {
- echo "missing new line: $line"
- return 1
- }
- done <new.txt
+ done <lines
'
test_done