aboutsummaryrefslogtreecommitdiffstats
path: root/tests/blogc/check_blogc.sh.in
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-04-22 02:06:37 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-04-22 02:06:37 +0200
commit8404096582103dccb8885b0c404f0a756685e913 (patch)
tree97d74ba2dd9591f55bd4284de6d40ba673eb8bec /tests/blogc/check_blogc.sh.in
parent67c856608a746b5205300d3f8141a6a29d3cc89e (diff)
downloadblogc-8404096582103dccb8885b0c404f0a756685e913.tar.gz
blogc-8404096582103dccb8885b0c404f0a756685e913.tar.bz2
blogc-8404096582103dccb8885b0c404f0a756685e913.zip
blogc: allow passing multiple -e options
Diffstat (limited to 'tests/blogc/check_blogc.sh.in')
-rwxr-xr-xtests/blogc/check_blogc.sh.in109
1 files changed, 108 insertions, 1 deletions
diff --git a/tests/blogc/check_blogc.sh.in b/tests/blogc/check_blogc.sh.in
index 3e0b8d7..87b71fa 100755
--- a/tests/blogc/check_blogc.sh.in
+++ b/tests/blogc/check_blogc.sh.in
@@ -170,7 +170,7 @@ cat > "${TEMP}/main.tmpl" <<EOF
<title>{% ifdef FOO1 %}{{ FOO1 }} {% endif %}{% block entry %}{{ TITLE }}{% endblock %}{% block listing_once %}{{ SITE_TITLE }}{% endblock %}</title>
</head>
<body>
- <a href="{{ BASE_URL }}/"><div class="name">{{ SITE_TITLE }}</div></a>{% block listing_entry %}{{ CONTENT }}{% endblock %}
+ <a href="{{ BASE_URL }}/"><div class="name">{{ SITE_TITLE }}</div></a>{% block listing_entry %}{{ CONTENT }}{% endblock %}{% block listing_entry %}{{ CONTENT }}{% endblock %}
{% block listing_once %}
<section class="main">
<div class="container">
@@ -469,6 +469,113 @@ echo -e "${TEMP}/post1.txt\n${TEMP}/post2.txt" | ${TESTS_ENVIRONMENT} @abs_top_b
diff -uN "${TEMP}/output12.html" "${TEMP}/expected-output3.html"
+cat > "${TEMP}/expected-output4.html" <<EOF
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>Chunda's website</title>
+ </head>
+ <body>
+ <a href="/"><div class="name">Chunda's website</div></a><p>foo?</p>
+
+
+ <section class="main">
+ <div class="container">
+ <div class="content">
+ <div class="page-heading">Blog</div>
+ <ul>
+
+
+ <li class="post-item">
+ <div class="meta">Jan 01, 2010, 11:11 AM GMT</div>
+ <a href="/post/post1/"><div>foo</div></a>
+ </li>
+
+ <li class="post-item">
+ <div class="meta">Jan 01, 2010, 10:22 PM GMT</div>
+ <a href="/post/post2/"><div>bar</div></a>
+ </li>
+
+
+ </ul>
+ </div>
+ </div>
+ </section>
+
+
+ </body>
+</html>
+EOF
+
+${TESTS_ENVIRONMENT} @abs_top_builddir@/blogc \
+ -D BASE_DOMAIN=http://bola.com/ \
+ -D BASE_URL= \
+ -D SITE_TITLE="Chunda's website" \
+ -D DATE_FORMAT="%b %d, %Y, %I:%M %p GMT" \
+ -e "" \
+ -e "${TEMP}/post1.txt" \
+ -e "${TEMP}/post3.txt" \
+ -t "${TEMP}/main.tmpl" \
+ -o "${TEMP}/output13.html" \
+ -l \
+ "${TEMP}/post1.txt" "${TEMP}/post2.txt"
+
+diff -uN "${TEMP}/output13.html" "${TEMP}/expected-output4.html"
+
+
+cat > "${TEMP}/expected-output5.html" <<EOF
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>Chunda's website</title>
+ </head>
+ <body>
+ <a href="/"><div class="name">Chunda's website</div></a><p>foo?</p>
+<p>bar?</p>
+
+
+ <section class="main">
+ <div class="container">
+ <div class="content">
+ <div class="page-heading">Blog</div>
+ <ul>
+
+
+ <li class="post-item">
+ <div class="meta">Jan 01, 2010, 11:11 AM GMT</div>
+ <a href="/post/post1/"><div>foo</div></a>
+ </li>
+
+ <li class="post-item">
+ <div class="meta">Jan 01, 2010, 10:22 PM GMT</div>
+ <a href="/post/post2/"><div>bar</div></a>
+ </li>
+
+
+ </ul>
+ </div>
+ </div>
+ </section>
+
+
+ </body>
+</html>
+EOF
+
+${TESTS_ENVIRONMENT} @abs_top_builddir@/blogc \
+ -D BASE_DOMAIN=http://bola.com/ \
+ -D BASE_URL= \
+ -D SITE_TITLE="Chunda's website" \
+ -D DATE_FORMAT="%b %d, %Y, %I:%M %p GMT" \
+ -e "${TEMP}/post1.txt" \
+ -e "${TEMP}/post3.txt" \
+ -t "${TEMP}/main.tmpl" \
+ -o "${TEMP}/output14.html" \
+ -l \
+ "${TEMP}/post1.txt" "${TEMP}/post2.txt"
+
+diff -uN "${TEMP}/output14.html" "${TEMP}/expected-output5.html"
+
echo "{% block listig %}foo{% endblock %}\n" > "${TEMP}/error.tmpl"
${TESTS_ENVIRONMENT} @abs_top_builddir@/blogc \