From 4cfe7958e5fb106a9febfc224dca0bdb8324e3dd Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sat, 19 Nov 2016 15:08:12 +0100
Subject: [PATCH] Broaden test.

---
 test.sh                      | 17 ++++++++++-------
 test/test_files/bar baz.html | 12 ++++++++++++
 test/test_files/foo.html     | 13 +++++++++++++
 test/test_files/test.html    | 12 ++++++++++++
 4 files changed, 47 insertions(+), 7 deletions(-)
 create mode 100644 test/test_files/bar baz.html
 create mode 100644 test/test_files/foo.html
 create mode 100644 test/test_files/test.html

diff --git a/test.sh b/test.sh
index 00194ba..97d0fbf 100755
--- 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
index 0000000..442f9ac
--- /dev/null
+++ b/test/test_files/bar baz.html	
@@ -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
index 0000000..aa3575d
--- /dev/null
+++ b/test/test_files/foo.html
@@ -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
index 0000000..787bf0e
--- /dev/null
+++ b/test/test_files/test.html
@@ -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
-- 
2.30.2