blob: 5676893ba17eef3818f1cf3d69963936840da983 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
tfile="${CTDB_TEST_TMP_DIR}/line.$$"
remove_files ()
{
rm -f "$tfile"
}
test_cleanup remove_files
> "$tfile"
ok_null
unit_test line_test "$tfile"
printf "\0" > "$tfile"
required_result 1 <<EOF
EOF
unit_test line_test "$tfile"
echo -n "hello" > "$tfile"
ok_null
unit_test line_test "$tfile"
cat <<EOF > "$tfile"
hello
world
EOF
required_result 2 << EOF
hello
world
EOF
unit_test line_test "$tfile"
required_result 2 << EOF
hello
world
EOF
unit_test line_test "$tfile"
cat <<EOF > "$tfile"
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
EOF
required_result 1 <<EOF
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
EOF
unit_test line_test "$tfile"
cat <<EOF > "$tfile"
line number one
line number two
line number one
line number two
line number one
EOF
required_result 5 <<EOF
line number one
line number two
line number one
line number two
line number one
EOF
unit_test line_test "$tfile" 64
cat <<EOF > "$tfile"
this is line number one
this is line number two
this is line number three
this is line number four
this is line number five
EOF
required_result 5 <<EOF
this is line number one
this is line number two
this is line number three
this is line number four
this is line number five
EOF
unit_test line_test "$tfile" 64
|