Add a helper function for comparing files.
authorAdam Sampson <ats@offog.org>
Sun, 7 Jul 2013 16:49:03 +0000 (16:49 +0000)
committerAdam Sampson <ats@offog.org>
Sun, 7 Jul 2013 16:49:03 +0000 (16:49 +0000)
test-rawdog

index 1b276932231f69e70bf992d6de2179f9f97aba65..96cc39d9c0eac23677ed4218465af25e6fb01fb3 100644 (file)
@@ -75,6 +75,12 @@ equals () {
        fi
 }
 
+same () {
+       if ! cmp "$1" "$2"; then
+               die "expected $1 to have the same contents as $2"
+       fi
+}
+
 contains () {
        file="$1"
        shift
@@ -658,9 +664,7 @@ add "itemtemplate item"
 add "feedlisttemplate feedlist"
 add "feeditemtemplate feeditem"
 run -w
-if ! cmp $statedir/output.html.orig $statedir/output.html; then
-       die "output different from default templates"
-fi
+same $statedir/output.html.orig $statedir/output.html
 
 begin "pre-2.15 template options"
 run -t