aurweb/test/t2600-rendercomment.sh
Lukas Fleischer 9aa4203c7e Add Markdown support to package comments
Support Markdown syntax in package comments. Among other things, this
makes it easier to paste command line output and patches.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-23 18:43:26 +02:00

23 lines
522 B
Bash
Executable file

#!/bin/sh
test_description='rendercomment tests'
. ./setup.sh
test_expect_success 'Test comment rendering.' '
cat <<-EOD | sqlite3 aur.db &&
INSERT INTO PackageComments (ID, PackageBaseID, Comments, RenderedComment) VALUES (1, 1, "Hello world!
This is a comment.", "");
EOD
"$RENDERCOMMENT" 1 &&
cat <<-EOD >expected &&
<p>Hello world!<br>
This is a comment.</p>
EOD
cat <<-EOD | sqlite3 aur.db >actual &&
SELECT RenderedComment FROM PackageComments WHERE ID = 1;
EOD
test_cmp actual expected
'
test_done