aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-09-17 22:34:52 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-09-17 22:34:52 +0200
commit56509ab16c8d2225182eb0400e5c6a4900870391 (patch)
treee3c3bcc760ecc187a3f4ee8c6616855d15e86d83 /t
parent3e400c3df5572524b7ba08b030f45eb3ba6b7734 (diff)
downloadcforum-56509ab16c8d2225182eb0400e5c6a4900870391.tar.gz
Fix mktpl bug
Diffstat (limited to 't')
-rw-r--r--t/err.tc2
-rw-r--r--t/front.tc6
-rw-r--r--t/post.t12
-rw-r--r--t/post.tc18
4 files changed, 28 insertions, 10 deletions
diff --git a/t/err.tc b/t/err.tc
index f6d48ab..c4369a9 100644
--- a/t/err.tc
+++ b/t/err.tc
@@ -2,4 +2,4 @@ printf("<h1>");
printf("%s", title );
printf("</h1>\n<p>");
printf("%s", err );
-printf("</p>\n");
+printf("</p>");
diff --git a/t/front.tc b/t/front.tc
index 3307c21..d7afb7b 100644
--- a/t/front.tc
+++ b/t/front.tc
@@ -6,10 +6,12 @@ printf(" request!</p>\n<table border=\"1\">\n <tr style=\"font-weight: bold;\">\
char *p, *v;
while(p = nextparam(GET, 512)){
v = split(p);
- printf("\n <tr>\n <td>");
+
+printf("\n <tr>\n <td>");
printf("%s", p );
printf("</td>\n <td>");
printf("%s", v );
printf("</td>\n </tr>\n ");
}
- printf("\n</table>");
+
+printf("\n</table>");
diff --git a/t/post.t b/t/post.t
index 56d3c37..83529d7 100644
--- a/t/post.t
+++ b/t/post.t
@@ -1,7 +1,13 @@
<h1>Post <% printf("%d", id); %>: <%= post->subject %></h1>
-<p>From: <%= user->full %>
-&lt;<a href="?user=<% printf("%d", user->id); %>"><%= user->name %></a>&gt;
-<br>Date: <% PFREE(date(post->created)); %>
+<p>From: <%= user->full? user->full: "" %> <%
+if(user->full) printf("&lt;");
+%><a href="?user=<% printf("%d", user->id); %>"><%= user->name %></a><%
+if(user->full) printf("&gt;"); %>
+<br>Date: <% printdate(post->created); %>
+<% if(post->edited){
+ printf("<br>Edited: ");
+ printdate(post->edited);
+} %>
<pre>
<%= post->text %>
</pre> \ No newline at end of file
diff --git a/t/post.tc b/t/post.tc
index 2f81de0..732f0a7 100644
--- a/t/post.tc
+++ b/t/post.tc
@@ -3,13 +3,23 @@ printf("%d", id);
printf(": ");
printf("%s", post->subject );
printf("</h1>\n<p>From: ");
-printf("%s", user->full );
-printf("\n&lt;<a href=\"?user=");
+printf("%s", user->full? user->full: "" );
+printf(" ");
+if(user->full) printf("&lt;");
+
+printf("<a href=\"?user=");
printf("%d", user->id);
printf("\">");
printf("%s", user->name );
-printf("</a>&gt;\n<br>Date: ");
-PFREE(date(post->created));
+printf("</a>");
+if(user->full) printf("&gt;");
+printf("\n<br>Date: ");
+printdate(post->created);
+printf("\n");
+if(post->edited){
+ printf("<br>Edited: ");
+ printdate(post->edited);
+}
printf("\n<pre>\n");
printf("%s", post->text );
printf("\n</pre>");