6 printf "== %s UUID pattern match test ==\n" "$uuid_file"
7 if cat "$uuid_file" | grep -Eq "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; then
8 echo "== test SUCCESS =="
10 echo "== test FAILURE =="
18 printf "== %s diff test ==\n" "$generated_file"
19 diff "$expected_file" "$generated_file"
20 if [ "$?" = "0" ]; then
21 echo "== test SUCCESS =="
23 echo "== test FAILURE =="
28 ./add_dir.sh test/test_dir
29 cp test/test_files/test.md test/test_dir/
30 cp test/test_files/foo.rst test/test_dir/
31 cp test/test_files/bar\ baz.md test/test_dir/
35 uuid_regex="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
36 for file in test/test_files/*.html test/test_files/*.meta; do
37 cmp_file=`echo "$file" | sed 's/test_files/test_dir/'`
38 if [ ! "$file" = "test/test_files/index.html" ] && \
39 echo "$file" | grep -q "\.html$"; then
40 uuid_test "${cmp_file%.html}.uuid"
42 diff_test "$file" "$cmp_file"
44 uuid_test "test/test_dir/uuid.meta"
45 original_file="test/test_dir/feed.xml"
46 generated_file="$original_file".ignoring
47 expected_file="test/test_files/feed.xml.ignoring"
48 cat "$original_file" | \
49 sed 's/>[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}T[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}Z</>IGNORE</' | \
50 sed 's/>urn:uuid:[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}</>urn:uuid:IGNORE</' \
52 diff_test "$generated_file" "$expected_file"