mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
add 3 testcases for mkd_basename (-b flag in the markdown program)
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ e_basename(const char *string, const int size, void *context)
|
||||
char *ret;
|
||||
char *base = (char*)context;
|
||||
|
||||
if ( base && string && string[0] == '/' && (ret=malloc(strlen(base)+size+2)) ) {
|
||||
if ( base && string && (string[0] == '/') && (ret=malloc(strlen(base)+size+2)) ) {
|
||||
strcpy(ret, base);
|
||||
strncat(ret, string, size);
|
||||
return ret;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
. tests/functions.sh
|
||||
|
||||
title "mkd_basename (e_url)"
|
||||
|
||||
rc=0
|
||||
MARKDOWN_FLAGS=
|
||||
|
||||
try -bHOHO 'empty []() with baseurl' '[]()' '<p><a href="HOHO"></a></p>'
|
||||
try -bHOHO '[]() with full url' '[](http://foo)' '<p><a href="http://foo"></a></p>'
|
||||
try -bHOHO '[]() with url fragment' '[](/foo)' '<p><a href="HOHO/foo"></a></p>'
|
||||
|
||||
summary $0
|
||||
exit $rc
|
||||
Reference in New Issue
Block a user