added global variables, added default date for markdown

git-svn-id: file:///srv/svn/repo/aya/trunk@20 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
zaitsev.serge
2015-08-29 17:54:55 +00:00
parent d09f374110
commit 352ddac4b0
2 changed files with 39 additions and 19 deletions

View File

@@ -46,7 +46,7 @@ func TestMD(t *testing.T) {
empty:
bayan: [:|||:]
this: is a content`))
this: is a content`), Vars{})
if v["title"] != "Hello, world!" {
t.Error()
}
@@ -64,14 +64,14 @@ this: is a content`))
}
// Test empty md
v, body, _ = md(tmpfile("foo.md", ""))
if len(v) != 0 || len(body) != 0 {
v, body, _ = md(tmpfile("foo.md", ""), Vars{})
if v["url"] != "foo.html" || len(body) != 0 {
t.Error(v, body)
}
// Test empty header
v, body, _ = md(tmpfile("foo.md", "Hello"))
if len(v) != 0 || body != "Hello" {
v, body, _ = md(tmpfile("foo.md", "Hello"), Vars{})
if v["url"] != "foo.html" || body != "Hello" {
t.Error(v, body)
}
}