wafsamba: fix pidl dependencies to rebuild on pidl changes
[Samba.git] / ctdb / tests / cunit / line_test_001.sh
blob991d01a24e7451089abb73e1753c747ca542c7dd
1 #!/bin/sh
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
5 tfile="${TEST_VAR_DIR}/line.$$"
7 remove_files ()
9 rm -f "$tfile"
12 test_cleanup remove_files
14 > "$tfile"
16 ok_null
17 unit_test line_test "$tfile"
19 printf "\0" > "$tfile"
21 required_result 1 <<EOF
23 EOF
25 unit_test line_test "$tfile"
27 echo -n "hello" > "$tfile"
29 ok_null
30 unit_test line_test "$tfile"
32 cat <<EOF > "$tfile"
33 hello
34 world
35 EOF
37 required_result 2 << EOF
38 hello
39 world
40 EOF
41 unit_test line_test "$tfile"
43 required_result 2 << EOF
44 hello
45 world
46 EOF
47 unit_test line_test "$tfile"
49 cat <<EOF > "$tfile"
50 This is a really long long line full of random words and hopefully it will be read properly by the line test program and identified as a single line
51 EOF
53 required_result 1 <<EOF
54 This is a really long long line full of random words and hopefully it will be read properly by the line test program and identified as a single line
55 EOF
56 unit_test line_test "$tfile"
58 cat <<EOF > "$tfile"
59 line number one
60 line number two
61 line number one
62 line number two
63 line number one
64 EOF
66 required_result 5 <<EOF
67 line number one
68 line number two
69 line number one
70 line number two
71 line number one
72 EOF
73 unit_test line_test "$tfile" 64
75 cat <<EOF > "$tfile"
76 this is line number one
77 this is line number two
78 this is line number three
79 this is line number four
80 this is line number five
81 EOF
83 required_result 5 <<EOF
84 this is line number one
85 this is line number two
86 this is line number three
87 this is line number four
88 this is line number five
89 EOF
90 unit_test line_test "$tfile" 64