From: Christian Heller <c.heller@plomlompom.de> Date: Wed, 18 Jan 2017 23:47:31 +0000 (+0100) Subject: Harden tests via more dangerous source file name. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7Bprefix%7D%7D/booking?a=commitdiff_plain;h=8e8f1f35cafef90dbcac0682c810b8aa4a07260e;p=redo-blog Harden tests via more dangerous source file name. --- diff --git a/test.sh b/test.sh index c6e9c8f..ab23cf8 100755 --- a/test.sh +++ b/test.sh @@ -49,7 +49,7 @@ rm -rf "$generated_files_dir" working_dir=$(pwd) cd "$generated_files_dir" redo -cp "$working_dir/$expected_files_dir"/test.md . +cp "$working_dir/$expected_files_dir"/te\"\;st.md . redo cp "$working_dir/$expected_files_dir"/bar\ baz.md . redo @@ -102,11 +102,6 @@ for file in "$expected_files_dir"/*.html.ignoring; do cat "$cmp_file" | \ sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/IGNORE/g' \ > "$generated_file" -# cat "$cmp_file" | \ -# sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/IGNORE/g' | \ -# sed 's/IGNORET[0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}Z/IGNORE/g' | \ -# sed 's/IGNORE [0-9]\{2\}:[0-9]\{2\} (UTC)/IGNORE/g' \ -# > "$generated_file" diff_test "$file" "$generated_file" done diff --git a/test/test_files/feed.xml.ignoring b/test/test_files/feed.xml.ignoring index 29d2392..f819425 100644 --- a/test/test_files/feed.xml.ignoring +++ b/test/test_files/feed.xml.ignoring @@ -12,7 +12,7 @@ <id>urn:uuid:IGNORE</id> <updated>IGNORE</updated> <published>IGNORE</published> -<link href="http://example.org/test.html" rel="alternate" type="text/html" /> +<link href="http://example.org/te%26quot%3Bst.html" rel="alternate" type="text/html" /> <content type="html"> <p>foo</p> <h2 id="bar">bar</h2> diff --git a/test/test_files/index.html.ignoring b/test/test_files/index.html.ignoring index 8643e6f..2985375 100644 --- a/test/test_files/index.html.ignoring +++ b/test/test_files/index.html.ignoring @@ -10,5 +10,5 @@ h1 { font-size: 2em; } <ul> <li><a href="foo.html">a title with some nasty characters: &<>"' %BODY%</a> (<time>IGNORE</time>)</li> <li><a href="bar%20baz.html">foo</a> (<time>IGNORE</time>)</li> -<li><a href="test.html">foo <em>bar</em> <strong>baz</strong></a> (<time>IGNORE</time>)</li> +<li><a href="te%26quot%3Bst.html">foo <em>bar</em> <strong>baz</strong></a> (<time>IGNORE</time>)</li> </ul> \ No newline at end of file diff --git a/test/test_files/te"st.html.ignoring b/test/test_files/te"st.html.ignoring new file mode 100644 index 0000000..d751b3b --- /dev/null +++ b/test/test_files/te"st.html.ignoring @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<style type="text/css"> +h1 { font-size: 2em; } +h2 { font-size: 1.5em; } +h3 { font-size: 1.17em; } +h4 { font-size: 1.12em; } +h5 { font-size: .83em; } +h6 { font-size: .75em; } +header h1 { margin-bottom: 0.1em; } +header p { margin: 0; } +</style> +<title>Yet another blog â foo bar baz</title> +<a href="index.html">Yet another blog</a> +<article> +<header> +<h1>foo <em>bar</em> <strong>baz</strong></h1> +<p>created: <time>IGNORE</time> / last update: <time>IGNORE</time></p> +</header> +<p>foo</p> +<h2 id="bar">bar</h2> +<p>baz</p> +<footer> +Links back: +<ul> +</ul> +</footer> +</article> \ No newline at end of file diff --git a/test/test_files/te"st.md b/test/test_files/te"st.md new file mode 100644 index 0000000..7bf4dce --- /dev/null +++ b/test/test_files/te"st.md @@ -0,0 +1,6 @@ +%foo *bar* **baz** +foo + +# bar + +baz diff --git a/test/test_files/test.html.ignoring b/test/test_files/test.html.ignoring deleted file mode 100644 index d751b3b..0000000 --- a/test/test_files/test.html.ignoring +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html> -<meta charset="UTF-8"> -<style type="text/css"> -h1 { font-size: 2em; } -h2 { font-size: 1.5em; } -h3 { font-size: 1.17em; } -h4 { font-size: 1.12em; } -h5 { font-size: .83em; } -h6 { font-size: .75em; } -header h1 { margin-bottom: 0.1em; } -header p { margin: 0; } -</style> -<title>Yet another blog â foo bar baz</title> -<a href="index.html">Yet another blog</a> -<article> -<header> -<h1>foo <em>bar</em> <strong>baz</strong></h1> -<p>created: <time>IGNORE</time> / last update: <time>IGNORE</time></p> -</header> -<p>foo</p> -<h2 id="bar">bar</h2> -<p>baz</p> -<footer> -Links back: -<ul> -</ul> -</footer> -</article> \ No newline at end of file diff --git a/test/test_files/test.md b/test/test_files/test.md deleted file mode 100644 index 7bf4dce..0000000 --- a/test/test_files/test.md +++ /dev/null @@ -1,6 +0,0 @@ -%foo *bar* **baz** -foo - -# bar - -baz