From 2793a94367e7b163ff3738619a2a764f1c6645b7 Mon Sep 17 00:00:00 2001
From: "Rafael G. Martins"
Date: Sat, 27 Apr 2019 02:56:52 +0200
Subject: make: support posts sorting
---
tests/blogc-make/check_blogc_make.sh.in | 220 ++++++++++++++++++++++++++++++++
1 file changed, 220 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 14223d0..36dfceb 100755
--- a/tests/blogc-make/check_blogc_make.sh.in
+++ b/tests/blogc-make/check_blogc_make.sh.in
@@ -755,6 +755,226 @@ 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_sort
+
+cat > "${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/post/foo/index\\.html" "${TEMP}/output.txt"
+grep "_build/post/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/post/bar/index.html
+ 2016-09-01T00:00:00Z
+ 2016-09-01T00:00:00Z
+
+
+ Lol
+ author@example.com
+
+ This is bar.
+]]>
+
+
+
+ Foo
+ http://example.org/post/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/post/foo/index.html" "${TEMP}/expected-post-foo.html"
+
+cat > "${TEMP}/expected-post-bar.html" <This is bar.
+
+
+EOF
+diff -uN "${TEMP}/proj/_build/post/bar/index.html" "${TEMP}/expected-post-bar.html"
+
+rm -rf "${TEMP}/proj/_build"
+
+
+### default settings with some posts, order desc, posts_sort
+
+cat > "${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/post/foo/index\\.html" "${TEMP}/output.txt"
+grep "_build/post/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-10-01T00:00:00Z
+
+
+
+ Lol
+ author@example.com
+
+ WAT?!
+
+
+ Foo
+ http://example.org/post/foo/index.html
+ 2016-10-01T00:00:00Z
+ 2016-10-01T00:00:00Z
+
+
+ Lol
+ author@example.com
+
+ This is foo.
+]]>
+
+
+
+ Bar
+ http://example.org/post/bar/index.html
+ 2016-09-01T00:00:00Z
+ 2016-09-01T00:00:00Z
+
+
+ Lol
+ author@example.com
+
+ This is bar.
+]]>
+
+
+
+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/post/foo/index.html" "${TEMP}/expected-post-foo.html"
+
+cat > "${TEMP}/expected-post-bar.html" <This is bar.
+
+
+EOF
+diff -uN "${TEMP}/proj/_build/post/bar/index.html" "${TEMP}/expected-post-bar.html"
+
+rm -rf "${TEMP}/proj/_build"
+
+
### default settings with some posts, order asc, listing_entry
cat > "${TEMP}/proj/content/hue.txt" <