From 56509ab16c8d2225182eb0400e5c6a4900870391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 17 Sep 2021 22:34:52 +0200 Subject: Fix mktpl bug --- t/err.tc | 2 +- t/front.tc | 6 ++++-- t/post.t | 12 +++++++++--- t/post.tc | 18 ++++++++++++++---- 4 files changed, 28 insertions(+), 10 deletions(-) (limited to 't') 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("

"); printf("%s", title ); printf("

\n

"); printf("%s", err ); -printf("

\n"); +printf("

"); 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!

\n\n \ char *p, *v; while(p = nextparam(GET, 512)){ v = split(p); - printf("\n \n \n \n \n \n "); } - printf("\n
"); + +printf("\n
"); printf("%s", p ); printf(""); printf("%s", v ); printf("
"); + +printf("\n"); 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 @@

Post <% printf("%d", id); %>: <%= post->subject %>

-

From: <%= user->full %> -<id); %>"><%= user->name %>> -
Date: <% PFREE(date(post->created)); %> +

From: <%= user->full? user->full: "" %> <% +if(user->full) printf("<"); +%>id); %>"><%= user->name %><% +if(user->full) printf(">"); %> +
Date: <% printdate(post->created); %> +<% if(post->edited){ + printf("
Edited: "); + printdate(post->edited); +} %>

 <%= post->text %>
 
\ 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("\n

From: "); -printf("%s", user->full ); -printf("\n<full? user->full: "" ); +printf(" "); +if(user->full) printf("<"); + +printf("id); printf("\">"); printf("%s", user->name ); -printf(">\n
Date: "); -PFREE(date(post->created)); +printf(""); +if(user->full) printf(">"); +printf("\n
Date: "); +printdate(post->created); +printf("\n"); +if(post->edited){ + printf("
Edited: "); + printdate(post->edited); +} printf("\n

\n");
 printf("%s",  post->text );
 printf("\n
"); -- cgit v1.2.3