From 792ac4ec66dd098109a88065420ef95c1a78624f Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sat, 27 Apr 2019 04:22:56 +0200 Subject: make: support posts autoloading --- tests/blogc-make/check_blogc_make.sh.in | 248 ++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) (limited to 'tests') diff --git a/tests/blogc-make/check_blogc_make.sh.in b/tests/blogc-make/check_blogc_make.sh.in index 36dfceb..d171027 100755 --- a/tests/blogc-make/check_blogc_make.sh.in +++ b/tests/blogc-make/check_blogc_make.sh.in @@ -755,6 +755,254 @@ diff -uN "${TEMP}/proj/_build/post/post11/index.html" "${TEMP}/expected-post-pos rm -rf "${TEMP}/proj/_build" +### default settings with some posts, order asc, posts_autoload + +mkdir -p "${TEMP}/proj/content/post2" + +cat > "${TEMP}/proj/content/post2/foo.txt" < "${TEMP}/proj/content/post2/bar.txt" < "${TEMP}/proj/blogcfile" <&1 | tee "${TEMP}/output.txt" +grep "_build/index\\.html" "${TEMP}/output.txt" +grep "_build/atom\\.xml" "${TEMP}/output.txt" +grep "_build/page/1/index\\.html" "${TEMP}/output.txt" +grep "_build/post2/foo/index\\.html" "${TEMP}/output.txt" +grep "_build/post2/bar/index\\.html" "${TEMP}/output.txt" + +rm "${TEMP}/output.txt" + +cat > "${TEMP}/expected-index.html" < "${TEMP}/expected-atom.xml" < + + Lol's Website + http://example.org/atom.xml + 2016-09-01T00:00:00Z + + + + Lol + author@example.com + + WAT?! + + + Bar + http://example.org/post2/bar/index.html + 2016-09-01T00:00:00Z + 2016-09-01T00:00:00Z + + + Lol + author@example.com + + This is bar.

+]]>
+
+ + + Foo + http://example.org/post2/foo/index.html + 2016-10-01T00:00:00Z + 2016-10-01T00:00:00Z + + + Lol + author@example.com + + This is foo.

+]]>
+
+ +
+EOF +diff -uN "${TEMP}/proj/_build/atom.xml" "${TEMP}/expected-atom.xml" + +cat > "${TEMP}/expected-post-foo.html" <This is foo.

+ + +EOF +diff -uN "${TEMP}/proj/_build/post2/foo/index.html" "${TEMP}/expected-post-foo.html" + +cat > "${TEMP}/expected-post-bar.html" <This is bar.

+ + +EOF +diff -uN "${TEMP}/proj/_build/post2/bar/index.html" "${TEMP}/expected-post-bar.html" + +rm -rf "${TEMP}/proj/_build" "${TEMP}/proj/content/post2" + + +### default settings with some posts, order desc, posts_autoload + +mkdir -p "${TEMP}/proj/content/post2" + +cat > "${TEMP}/proj/content/post2/foo.txt" < "${TEMP}/proj/content/post2/bar.txt" < "${TEMP}/proj/blogcfile" <&1 | tee "${TEMP}/output.txt" +grep "_build/index\\.html" "${TEMP}/output.txt" +grep "_build/atom\\.xml" "${TEMP}/output.txt" +grep "_build/page/1/index\\.html" "${TEMP}/output.txt" +grep "_build/post2/foo/index\\.html" "${TEMP}/output.txt" +grep "_build/post2/bar/index\\.html" "${TEMP}/output.txt" + +rm "${TEMP}/output.txt" + +cat > "${TEMP}/expected-index.html" < "${TEMP}/expected-atom.xml" < + + Lol's Website + http://example.org/atom.xml + 2016-09-01T00:00:00Z + + + + Lol + author@example.com + + WAT?! + + + Bar + http://example.org/post2/bar/index.html + 2016-09-01T00:00:00Z + 2016-09-01T00:00:00Z + + + Lol + author@example.com + + This is bar.

+]]>
+
+ + + Foo + http://example.org/post2/foo/index.html + 2016-08-01T00:00:00Z + 2016-08-01T00:00:00Z + + + Lol + author@example.com + + This is foo.

+]]>
+
+ +
+EOF +diff -uN "${TEMP}/proj/_build/atom.xml" "${TEMP}/expected-atom.xml" + +cat > "${TEMP}/expected-post-foo.html" <This is foo.

+ + +EOF +diff -uN "${TEMP}/proj/_build/post2/foo/index.html" "${TEMP}/expected-post-foo.html" + +cat > "${TEMP}/expected-post-bar.html" <This is bar.

+ + +EOF +diff -uN "${TEMP}/proj/_build/post2/bar/index.html" "${TEMP}/expected-post-bar.html" + +rm -rf "${TEMP}/proj/_build" "${TEMP}/proj/content/post2" + + ### default settings with some posts, order asc, posts_sort cat > "${TEMP}/proj/blogcfile" <