comparison zs_test.go @ 19:802b96e67bae draft

added global variables, added default date for markdown
author zaitsev.serge
date Sat, 29 Aug 2015 17:54:55 +0000
parents ae3116ea938b
children 40f55059fbfa
comparison
equal deleted inserted replaced
18:ae3116ea938b 19:802b96e67bae
44 title: Hello, world! 44 title: Hello, world!
45 keywords: foo, bar, baz 45 keywords: foo, bar, baz
46 empty: 46 empty:
47 bayan: [:|||:] 47 bayan: [:|||:]
48 48
49 this: is a content`)) 49 this: is a content`), Vars{})
50 if v["title"] != "Hello, world!" { 50 if v["title"] != "Hello, world!" {
51 t.Error() 51 t.Error()
52 } 52 }
53 if v["keywords"] != "foo, bar, baz" { 53 if v["keywords"] != "foo, bar, baz" {
54 t.Error() 54 t.Error()
62 if body != "this: is a content" { 62 if body != "this: is a content" {
63 t.Error(body) 63 t.Error(body)
64 } 64 }
65 65
66 // Test empty md 66 // Test empty md
67 v, body, _ = md(tmpfile("foo.md", "")) 67 v, body, _ = md(tmpfile("foo.md", ""), Vars{})
68 if len(v) != 0 || len(body) != 0 { 68 if v["url"] != "foo.html" || len(body) != 0 {
69 t.Error(v, body) 69 t.Error(v, body)
70 } 70 }
71 71
72 // Test empty header 72 // Test empty header
73 v, body, _ = md(tmpfile("foo.md", "Hello")) 73 v, body, _ = md(tmpfile("foo.md", "Hello"), Vars{})
74 if len(v) != 0 || body != "Hello" { 74 if v["url"] != "foo.html" || body != "Hello" {
75 t.Error(v, body) 75 t.Error(v, body)
76 } 76 }
77 } 77 }
78 78
79 func TestRender(t *testing.T) { 79 func TestRender(t *testing.T) {