From e4c08cd44e37f28cd11d62a95f4791ace663c62d Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 24 Jul 2018 21:54:27 +0200 Subject: make: fixed filename generation for rules and atom feed --- tests/blogc-make/check_blogc_make.sh.in | 526 +++++++++++++++++++++++++++++--- 1 file changed, 478 insertions(+), 48 deletions(-) (limited to 'tests/blogc-make/check_blogc_make.sh.in') diff --git a/tests/blogc-make/check_blogc_make.sh.in b/tests/blogc-make/check_blogc_make.sh.in index 064c801..2a82b2d 100755 --- a/tests/blogc-make/check_blogc_make.sh.in +++ b/tests/blogc-make/check_blogc_make.sh.in @@ -111,10 +111,10 @@ cat > "${TEMP}/expected-atom.xml" < Bar - /post/bar/ + /post/bar/index.html 2016-09-01T00:00:00Z 2016-09-01T00:00:00Z - + Lol author@example.com @@ -125,10 +125,10 @@ cat > "${TEMP}/expected-atom.xml" < Foo - /post/foo/ + /post/foo/index.html 2016-10-01T00:00:00Z 2016-10-01T00:00:00Z - + Lol author@example.com @@ -255,10 +255,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 11 - /post/post11/ + /post/post11/index.html 2016-09-11T00:00:00Z 2016-09-11T00:00:00Z - + Lol author@example.com @@ -269,10 +269,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 10 - /post/post10/ + /post/post10/index.html 2016-09-10T00:00:00Z 2016-09-10T00:00:00Z - + Lol author@example.com @@ -283,10 +283,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 09 - /post/post09/ + /post/post09/index.html 2016-09-09T00:00:00Z 2016-09-09T00:00:00Z - + Lol author@example.com @@ -297,10 +297,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 08 - /post/post08/ + /post/post08/index.html 2016-09-08T00:00:00Z 2016-09-08T00:00:00Z - + Lol author@example.com @@ -311,10 +311,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 07 - /post/post07/ + /post/post07/index.html 2016-09-07T00:00:00Z 2016-09-07T00:00:00Z - + Lol author@example.com @@ -325,10 +325,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 06 - /post/post06/ + /post/post06/index.html 2016-09-06T00:00:00Z 2016-09-06T00:00:00Z - + Lol author@example.com @@ -339,10 +339,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 05 - /post/post05/ + /post/post05/index.html 2016-09-05T00:00:00Z 2016-09-05T00:00:00Z - + Lol author@example.com @@ -353,10 +353,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 04 - /post/post04/ + /post/post04/index.html 2016-09-04T00:00:00Z 2016-09-04T00:00:00Z - + Lol author@example.com @@ -367,10 +367,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 03 - /post/post03/ + /post/post03/index.html 2016-09-03T00:00:00Z 2016-09-03T00:00:00Z - + Lol author@example.com @@ -381,10 +381,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 02 - /post/post02/ + /post/post02/index.html 2016-09-02T00:00:00Z 2016-09-02T00:00:00Z - + Lol author@example.com @@ -395,10 +395,10 @@ cat > "${TEMP}/expected-atom.xml" < Post 01 - /post/post01/ + /post/post01/index.html 2016-09-01T00:00:00Z 2016-09-01T00:00:00Z - + Lol author@example.com @@ -559,10 +559,10 @@ cat > "${TEMP}/expected-atom.xml" < Foo - /post/foo/ + /post/foo/index.html 2016-10-01T00:00:00Z 2016-10-01T00:00:00Z - + Lol author@example.com @@ -573,10 +573,10 @@ cat > "${TEMP}/expected-atom.xml" < Bar - /post/bar/ + /post/bar/index.html 2016-09-01T00:00:00Z 2016-09-01T00:00:00Z - + Lol author@example.com @@ -674,10 +674,10 @@ cat > "${TEMP}/expected-atom.xml" < Foo - /post/foo/ + /post/foo/index.html 2016-10-01T00:00:00Z 2016-10-01T00:00:00Z - + Lol author@example.com @@ -688,10 +688,10 @@ cat > "${TEMP}/expected-atom.xml" < Bar - /post/bar/ + /post/bar/index.html 2016-09-01T00:00:00Z 2016-09-01T00:00:00Z - + Lol author@example.com @@ -702,10 +702,10 @@ cat > "${TEMP}/expected-atom.xml" < Baz - /post/baz/ + /post/baz/index.html 2016-08-01T00:00:00Z 2016-08-01T00:00:00Z - + Lol author@example.com @@ -734,10 +734,10 @@ cat > "${TEMP}/expected-atom-tag1.xml" < Baz - /post/baz/ + /post/baz/index.html 2016-08-01T00:00:00Z 2016-08-01T00:00:00Z - + Lol author@example.com @@ -766,10 +766,10 @@ cat > "${TEMP}/expected-atom-tag2.xml" < Baz - /post/baz/ + /post/baz/index.html 2016-08-01T00:00:00Z 2016-08-01T00:00:00Z - + Lol author@example.com @@ -993,10 +993,10 @@ cat > "${TEMP}/expected-atom.xml" < Foo - /poost/foo/ + /poost/foo.html 2016-10-01T00:00:00Z 2016-10-01T00:00:00Z - + Lol author@example.com @@ -1034,7 +1034,7 @@ diff -uN "${TEMP}/proj/_build/poost/bar.html" "${TEMP}/expected-post-bar.html" rm -rf "${TEMP}/proj/_build" -### default settings with some posts and tags +### custom settings with some posts and tags cat > "${TEMP}/proj/contents/poost/baz.blogc" < "${TEMP}/expected-atom-tag1.xml" < Baz - /poost/baz/ + /poost/baz.html 2016-08-01T00:00:00Z 2016-08-01T00:00:00Z - + Lol author@example.com @@ -1129,10 +1129,10 @@ cat > "${TEMP}/expected-atom-tag2.xml" < Baz - /poost/baz/ + /poost/baz.html 2016-08-01T00:00:00Z 2016-08-01T00:00:00Z - + Lol author@example.com @@ -1177,7 +1177,7 @@ diff -uN "${TEMP}/proj/_build/taag/tag2.html" "${TEMP}/expected-tag2.html" rm -rf "${TEMP}/proj/_build" -### default settings with some posts, pages and tags +### custom settings with some posts, pages and tags cat > "${TEMP}/proj/contents/page1.blogc" < "${TEMP}/proj/contents/foo.blogc" < "${TEMP}/proj/contents/bar.blogc" < "${TEMP}/proj/temp/main.html" < "${TEMP}/proj/blogcfile" <&1 | tee "${TEMP}/output.txt" +grep "_build/index\\.html" "${TEMP}/output.txt" +grep "_build/index\\.xml" "${TEMP}/output.txt" +grep "_build/1/index\\.html" "${TEMP}/output.txt" +grep "_build/2/index\\.html" "${TEMP}/output.txt" +grep "_build/foo/index\\.html" "${TEMP}/output.txt" +grep "_build/bar/index\\.html" "${TEMP}/output.txt" + +rm "${TEMP}/output.txt" + +cat > "${TEMP}/expected-index.html" < "${TEMP}/expected-page-2.html" < "${TEMP}/expected-atom.xml" < + + Lol's Website + /index.xml + 2016-10-01T00:00:00Z + + + + Lol + author@example.com + + WAT?! + + + Foo + /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/index.xml" "${TEMP}/expected-atom.xml" + +cat > "${TEMP}/expected-post-foo.html" <This is foo.

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

+ + +EOF +diff -uN "${TEMP}/proj/_build/bar/index.html" "${TEMP}/expected-post-bar.html" + +rm -rf "${TEMP}/proj/_build" + + +### empty prefixes with some posts and tags, and different exts + +cat > "${TEMP}/proj/contents/baz.blogc" < "${TEMP}/proj/blogcfile" <&1 | tee "${TEMP}/output.txt" +grep "_build/index\\.html" "${TEMP}/output.txt" +grep "_build/index\\.xml" "${TEMP}/output.txt" +grep "_build/tag1/index\\.xml" "${TEMP}/output.txt" +grep "_build/tag2/index\\.xml" "${TEMP}/output.txt" +grep "_build/1\\.html" "${TEMP}/output.txt" +grep "_build/2\\.html" "${TEMP}/output.txt" +grep "_build/3\\.html" "${TEMP}/output.txt" +grep "_build/foo\\.html" "${TEMP}/output.txt" +grep "_build/bar\\.html" "${TEMP}/output.txt" +grep "_build/baz\\.html" "${TEMP}/output.txt" +grep "_build/tag1\\.html" "${TEMP}/output.txt" +grep "_build/tag2\\.html" "${TEMP}/output.txt" + +rm "${TEMP}/output.txt" + +diff -uN "${TEMP}/proj/_build/index.html" "${TEMP}/expected-index.html" +diff -uN "${TEMP}/proj/_build/1.html" "${TEMP}/expected-index.html" +diff -uN "${TEMP}/proj/_build/2.html" "${TEMP}/expected-page-2.html" + +cat > "${TEMP}/expected-page-3.html" < "${TEMP}/expected-atom.xml" < + + Lol's Website + /index.xml + 2016-10-01T00:00:00Z + + + + Lol + author@example.com + + WAT?! + + + Foo + /foo.html + 2016-10-01T00:00:00Z + 2016-10-01T00:00:00Z + + + Lol + author@example.com + + This is foo.

+]]>
+
+ +
+EOF +diff -uN "${TEMP}/proj/_build/index.xml" "${TEMP}/expected-atom.xml" + +cat > "${TEMP}/expected-atom-tag1.xml" < + + Lol's Website - tag1 + /tag1/index.xml + 2016-08-01T00:00:00Z + + + + Lol + author@example.com + + WAT?! + + + Baz + /baz.html + 2016-08-01T00:00:00Z + 2016-08-01T00:00:00Z + + + Lol + author@example.com + + This is baz.

+]]>
+
+ +
+EOF +diff -uN "${TEMP}/proj/_build/tag1/index.xml" "${TEMP}/expected-atom-tag1.xml" + +cat > "${TEMP}/expected-atom-tag2.xml" < + + Lol's Website - tag2 + /tag2/index.xml + 2016-08-01T00:00:00Z + + + + Lol + author@example.com + + WAT?! + + + Baz + /baz.html + 2016-08-01T00:00:00Z + 2016-08-01T00:00:00Z + + + Lol + author@example.com + + This is baz.

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

+ + +EOF +diff -uN "${TEMP}/proj/_build/foo.html" "${TEMP}/expected-post-foo.html" +diff -uN "${TEMP}/proj/_build/bar.html" "${TEMP}/expected-post-bar.html" +diff -uN "${TEMP}/proj/_build/baz.html" "${TEMP}/expected-post-baz.html" + +cat > "${TEMP}/expected-tag1.html" < "${TEMP}/expected-tag2.html" < "${TEMP}/proj/contents/page1.blogc" < "${TEMP}/proj/contents/page2.blogc" <> "${TEMP}/proj/blogcfile" <&1 | tee "${TEMP}/output.txt" +grep "_build/index\\.html" "${TEMP}/output.txt" +grep "_build/index\\.xml" "${TEMP}/output.txt" +grep "_build/tag1/index\\.xml" "${TEMP}/output.txt" +grep "_build/tag2/index\\.xml" "${TEMP}/output.txt" +grep "_build/1\\.html" "${TEMP}/output.txt" +grep "_build/2\\.html" "${TEMP}/output.txt" +grep "_build/3\\.html" "${TEMP}/output.txt" +grep "_build/foo\\.html" "${TEMP}/output.txt" +grep "_build/bar\\.html" "${TEMP}/output.txt" +grep "_build/baz\\.html" "${TEMP}/output.txt" +grep "_build/tag1\\.html" "${TEMP}/output.txt" +grep "_build/tag2\\.html" "${TEMP}/output.txt" +grep "_build/page1\\.html" "${TEMP}/output.txt" +grep "_build/page2\\.html" "${TEMP}/output.txt" + +rm "${TEMP}/output.txt" + +diff -uN "${TEMP}/proj/_build/index.html" "${TEMP}/expected-index.html" +diff -uN "${TEMP}/proj/_build/1.html" "${TEMP}/expected-index.html" +diff -uN "${TEMP}/proj/_build/2.html" "${TEMP}/expected-page-2.html" +diff -uN "${TEMP}/proj/_build/3.html" "${TEMP}/expected-page-3.html" + +diff -uN "${TEMP}/proj/_build/index.xml" "${TEMP}/expected-atom.xml" +diff -uN "${TEMP}/proj/_build/tag1/index.xml" "${TEMP}/expected-atom-tag1.xml" +diff -uN "${TEMP}/proj/_build/tag2/index.xml" "${TEMP}/expected-atom-tag2.xml" + +diff -uN "${TEMP}/proj/_build/foo.html" "${TEMP}/expected-post-foo.html" +diff -uN "${TEMP}/proj/_build/bar.html" "${TEMP}/expected-post-bar.html" +diff -uN "${TEMP}/proj/_build/baz.html" "${TEMP}/expected-post-baz.html" + +diff -uN "${TEMP}/proj/_build/tag1.html" "${TEMP}/expected-tag1.html" +diff -uN "${TEMP}/proj/_build/tag2.html" "${TEMP}/expected-tag2.html" + +cat > "${TEMP}/expected-page1.html" <This is page 1.

+ + +EOF +diff -uN "${TEMP}/proj/_build/page1.html" "${TEMP}/expected-page1.html" + +cat > "${TEMP}/expected-page2.html" <This is page 2.

+ + +EOF +diff -uN "${TEMP}/proj/_build/page2.html" "${TEMP}/expected-page2.html" + +rm -rf "${TEMP}/proj/_build" -- cgit v1.2.3-18-g5258