home · contact · privacy
Rename generated meta files, test for them.
[redo-blog] / test.sh
1 #!/bin/sh
2
3 rm -rf test/test_dir
4 ./add_dir.sh test/test_dir
5 cp test/test_files/test.md test/test_dir/
6 cp test/test_files/foo.rst test/test_dir/
7 cp test/test_files/bar\ baz.md test/test_dir/
8 cd test/test_dir
9 redo
10 cd ../..
11 for file in test/test_files/*.html; do
12   cmp_file=`echo "$file" | sed 's/test_files/test_dir/'`
13   printf "== %s diff test ==\n" "$cmp_file"
14   diff "$file" "$cmp_file"
15   if [ "$?" = "0" ]; then
16     echo "== test SUCCESS =="
17   else
18     echo "== test FAILURE =="
19   fi
20 done
21 for file in test/test_files/*meta; do
22   if [ "$file" = "test/test_files/uuid.meta" ]; then
23     true
24     # TODO: validate UUID
25   else
26     cmp_file=`echo "$file" | sed 's/test_files/test_dir/'`
27     printf "== %s diff test ==\n" "$cmp_file"
28     diff "$file" "$cmp_file"
29     if [ "$?" = "0" ]; then
30       echo "== test SUCCESS =="
31     else
32       echo "== test FAILURE =="
33     fi
34   fi
35 done