Changeset 18 in code for trunk/zs_test.go


Ignore:
Timestamp:
Aug 29, 2015, 3:47:16 PM (10 years ago)
Author:
zaitsev.serge
Message:

added amber and gcss compilers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zs_test.go

    r7 r18  
    44        "bytes"
    55        "fmt"
     6        "io/ioutil"
    67        "log"
    78        "os"
     
    3233}
    3334
     35func tmpfile(path, s string) string {
     36        ioutil.WriteFile(path, []byte(s), 0644)
     37        return path
     38}
     39
    3440func TestMD(t *testing.T) {
    35         v, body := md("foo.md", `
     41        defer os.Remove("foo.md")
     42        v, body, _ := md(tmpfile("foo.md", `
    3643        title: Hello, world!
    3744        keywords: foo, bar, baz
     
    3946        bayan: [:|||:]
    4047
    41 this: is a content`)
     48this: is a content`))
    4249        if v["title"] != "Hello, world!" {
    4350                t.Error()
     
    5764
    5865        // Test empty md
    59         v, body = md("foo.md", "")
     66        v, body, _ = md(tmpfile("foo.md", ""))
    6067        if len(v) != 0 || len(body) != 0 {
    6168                t.Error(v, body)
     
    6370
    6471        // Test empty header
    65         v, body = md("foo.md", "Hello")
     72        v, body, _ = md(tmpfile("foo.md", "Hello"))
    6673        if len(v) != 0 || body != "Hello" {
    6774                t.Error(v, body)
     
    7077
    7178func TestRender(t *testing.T) {
    72         eval := func(a []string, vars map[string]string) (string, error) {
     79        eval := func(a []string, vars Vars) (string, error) {
    7380                return "hello", nil
    7481        }
Note: See TracChangeset for help on using the changeset viewer.