home · contact · privacy
Broaden test.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 19 Nov 2016 14:08:12 +0000 (15:08 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 19 Nov 2016 14:08:12 +0000 (15:08 +0100)
test.sh
test/test_files/bar baz.html [new file with mode: 0644]
test/test_files/foo.html [new file with mode: 0644]
test/test_files/test.html [new file with mode: 0644]

diff --git a/test.sh b/test.sh
index 00194ba7f644bebf3e245292be75b20e11ba5e70..97d0fbf1ccd88f6bad431d69044d67b04854907e 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -8,10 +8,13 @@ cp test/test_files/bar\ baz.md test/test_dir/
 cd test/test_dir
 redo
 cd ../..
-echo "== index.html diff test =="
-diff test/test_files/index.html test/test_dir/index.html
-if [ "$?" = "0" ]; then
-  echo "== test SUCCESS =="
-else
-  echo "== test FAILURE =="
-fi
+for file in test/test_files/*.html; do
+  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
+done
diff --git a/test/test_files/bar baz.html b/test/test_files/bar baz.html
new file mode 100644 (file)
index 0000000..442f9ac
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Yet another blog – foo</title>
+</head>
+<body>
+<h1>foo</h1>
+<section>
+<p>bar</p>
+</section>
+</body>
+</html>
\ No newline at end of file
diff --git a/test/test_files/foo.html b/test/test_files/foo.html
new file mode 100644 (file)
index 0000000..aa3575d
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Yet another blog – a title with some nasty characters: &amp;&lt;&gt;&quot;&#x27;</title>
+</head>
+<body>
+<h1>a title with some nasty characters: &amp;&lt;&gt;&quot;'</h1>
+<section>
+<p>this text contains some special characters: '&quot;&gt;&lt;&amp;</p>
+<p>and more than one paragraph</p>
+</section>
+</body>
+</html>
\ No newline at end of file
diff --git a/test/test_files/test.html b/test/test_files/test.html
new file mode 100644 (file)
index 0000000..787bf0e
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Yet another blog – foo bar baz</title>
+</head>
+<body>
+<h1>foo <em>bar</em> <strong>baz</strong></h1>
+<section>
+<p>bar</p>
+</section>
+</body>
+</html>
\ No newline at end of file