Changeset 24 in code for trunk/zs_test.go


Ignore:
Timestamp:
Aug 30, 2015, 12:20:35 PM (10 years ago)
Author:
zaitsev.serge
Message:

fixed output file names in html pages, fixed amber function bindings, replaced print command with build, fixed plugin functions, implemented zs and exec functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zs_test.go

    r20 r24  
    77        "log"
    88        "os"
    9         "os/exec"
    109        "strings"
    1110        "testing"
    12         "text/template"
    1311)
    1412
     
    7977func TestRender(t *testing.T) {
    8078        vars := map[string]string{"foo": "bar"}
    81         funcs := template.FuncMap{
     79        funcs := Funcs{
    8280                "greet": func(s ...string) string {
    8381                        if len(s) == 0 {
     
    139137}
    140138
    141 func TestEvalCommand(t *testing.T) {
    142         s, err := eval([]string{"echo", "hello"}, map[string]string{})
    143         if err != nil {
    144                 t.Error(err)
    145         }
    146         if s != "hello\n" {
    147                 t.Error(s)
    148         }
    149         _, err = eval([]string{"cat", "bogus/file"}, map[string]string{})
    150         if _, ok := err.(*exec.ExitError); !ok {
    151                 t.Error("expected ExitError")
    152         }
    153         _, err = eval([]string{"missing command"}, map[string]string{})
    154         if err != nil {
    155                 t.Error("missing command should be ignored")
    156         }
    157 }
    158 
    159139func TestHelperProcess(*testing.T) {
    160140        if os.Getenv("ZS_HELPER") != "1" {
Note: See TracChangeset for help on using the changeset viewer.