OSDN Git Service

* tests/lha-test12: should not use the raw CR code.
[lha/lha.git] / tests / lha-test12
1 # -*- shell-script -*-
2 message testing the end of line conversion.
3
4 # LF to CR LF in archive
5 $lha ct test-tmp-crlf.lzh test-a test-b test-c
6                                                         check $? $LINENO
7 # no convert
8 $lha xw=test-tmp-crlf test-tmp-crlf.lzh
9                                                         check $? $LINENO
10 # use GNU diff option --binary for DJGPP.
11 case `$lha --version 2>&1` in
12 *msdosdjgpp*)
13 diff -r --binary test-1 test-tmp-crlf
14   ;;
15 *)
16 diff -r test-1 test-tmp-crlf
17   ;;
18 esac
19 test $? -ne 0
20                                                         check $? $LINENO
21
22 sed -e 's/$/X/' < test-a | tr 'X' '\015' | diff test-tmp-crlf/test-a -
23                                                         check $? $LINENO
24 sed -e 's/$/X/' < test-b | tr 'X' '\015' | diff test-tmp-crlf/test-b -
25                                                         check $? $LINENO
26 sed -e 's/$/X/' < test-c | tr 'X' '\015' | diff test-tmp-crlf/test-c -
27                                                         check $? $LINENO
28 # CR LF to LF
29 $lha xtw=test-tmp-nl test-tmp-crlf.lzh
30                                                         check $? $LINENO
31 diff -r test-1 test-tmp-nl
32                                                         check $? $LINENO
33 # no convert
34 $lha c test-tmp-nl.lzh test-a test-b test-c
35                                                         check $? $LINENO
36 # CR LF to LF (cannot convert)
37 $lha xtw=test-tmp-nl2 test-tmp-nl.lzh
38                                                         check $? $LINENO
39 diff -r test-1 test-tmp-nl2
40                                                         check $? $LINENO