2
# exercise the no-newline-at-EOF bug
3
# Before the April 2010 fix, the "\ No newline at end of file"
4
# line would not be printed.
7
. "$srcdir/init.sh"; path_prepend_ ../src
9
printf '\n1' > a || framework_failure_
10
printf '\n0\n\n1' > b || framework_failure_
11
cat <<EOF > exp || framework_failure_
17
\ No newline at end of file
20
cat <<EOF > exp2 || framework_failure_
27
\ No newline at end of file
32
# So we don't have to record trailing blanks in expected output above.
33
opt=--suppress-blank-empty
35
diff $opt -U1 a b > out 2> err
38
sed -n '/^@@/,$p' out > k && mv k out || fail=1
39
compare out exp || fail=1
41
compare err /dev/null || fail=1
43
# Repeat, but with a newline at the end of "a".
46
diff $opt -U1 a b > out 2> err
49
sed -n '/^@@/,$p' out > k && mv k out || fail=1
50
compare out exp2 || fail=1
52
compare err /dev/null || fail=1