|
@@ -5,16 +5,30 @@
|
5
|
5
|
. <(ffoom init)
|
6
|
6
|
ffoo import ini
|
7
|
7
|
|
|
8
|
+enum_tests() {
|
|
9
|
+ echo "both_keys_and_sections"
|
|
10
|
+ echo "games_with_spaces"
|
|
11
|
+ echo "keys_only"
|
|
12
|
+ echo "keys_sections_spaces"
|
|
13
|
+ echo "path"
|
|
14
|
+ echo "plain"
|
|
15
|
+ echo "sections_only"
|
|
16
|
+ echo "strict_and_slash"
|
|
17
|
+ echo "strict_and_space"
|
|
18
|
+ echo "strict_and_tab"
|
|
19
|
+# echo "list_keys" # not implemented
|
|
20
|
+# echo "list_paths" # not implemented
|
|
21
|
+# echo "list_sections" # not implemented
|
|
22
|
+}
|
8
|
23
|
|
9
|
24
|
do_test() {
|
10
|
|
- local n=$1
|
11
|
|
- local head=$(cat "test$n" | head -1 | sed -e 's/\s*#\s*/#/g')
|
12
|
|
- local name=$(cut -d\# -f 2 <<<"$head")
|
|
25
|
+ local name=$1
|
|
26
|
+ local head=$(cat "$name" | head -1 | sed -e 's/\s*#\s*/#/g')
|
|
27
|
+ local desc=$(cut -d\# -f 2 <<<"$head")
|
13
|
28
|
local args=$(cut -d\# -f 3 <<<"$head")
|
14
|
|
- rlPhaseStartTest "$name"
|
15
|
|
- rlRun "iniread $args - < test$n > result$n"
|
16
|
|
- rlRun "diff -u oracle$n result$n"
|
17
|
|
- rlGetPhaseState || rlLogInfo "cat test$n"
|
|
29
|
+ rlPhaseStartTest "$desc"
|
|
30
|
+ rlRun "iniread $args - < $name > $name.result"
|
|
31
|
+ rlRun "diff -u $name.oracle $name.result"
|
18
|
32
|
rlPhaseEnd
|
19
|
33
|
}
|
20
|
34
|
|
|
@@ -23,13 +37,13 @@ rlJournalStart
|
23
|
37
|
|
24
|
38
|
rlPhaseStartSetup
|
25
|
39
|
tmp=$(mktemp -d)
|
26
|
|
- cp $(dirname $0)/data/iniread/* $tmp
|
|
40
|
+ cp $(dirname $0)/data/ini/iniread/* $tmp
|
27
|
41
|
pushd $tmp
|
28
|
42
|
rlPhaseEnd
|
29
|
43
|
|
30
|
|
- for n in $(seq 1 13);
|
|
44
|
+ for name in $(enum_tests);
|
31
|
45
|
do
|
32
|
|
- do_test $n
|
|
46
|
+ do_test $name
|
33
|
47
|
done
|
34
|
48
|
|
35
|
49
|
rlPhaseStartCleanup
|