mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Automatically detect Git commit identifiers, shorten them, and make them link to the cgit interface. Implements FS#43290. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
24 lines
648 B
Bash
Executable file
24 lines
648 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 PackageBases (ID, Name, PackagerUID, SubmittedTS, ModifiedTS, FlaggerComment) VALUES (1, "foobar", 1, 0, 0, "");
|
|
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
|