cd test/test_dir
redo
cd ../..
-for file in test/test_files/*.html; do
+for file in test/test_files/*.html test/test_files/*.meta; do
cmp_file=`echo "$file" | sed 's/test_files/test_dir/'`
printf "== %s diff test ==\n" "$cmp_file"
diff "$file" "$cmp_file"
echo "== test FAILURE =="
fi
done
-for file in test/test_files/*meta; do
- if [ "$file" = "test/test_files/uuid.meta" ]; then
- true
- # TODO: validate UUID
- else
- cmp_file=`echo "$file" | sed 's/test_files/test_dir/'`
- printf "== %s diff test ==\n" "$cmp_file"
- diff "$file" "$cmp_file"
- if [ "$?" = "0" ]; then
- echo "== test SUCCESS =="
- else
- echo "== test FAILURE =="
- fi
- fi
-done
+uuid_file=test/test_dir/uuid.meta
+printf "== %s UUID pattern match test ==\n" "$uuid_file"
+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
+ echo "== test SUCCESS =="
+else
+ echo "== test FAILURE =="
+fi