diff zs_test.go @ 23:40f55059fbfa draft

fixed output file names in html pages, fixed amber function bindings, replaced print command with build, fixed plugin functions, implemented zs and exec functions
author zaitsev.serge
date Sun, 30 Aug 2015 12:20:35 +0000
parents 802b96e67bae
children e3c902a7380d
line wrap: on
line diff
--- a/zs_test.go	Sat Aug 29 21:58:48 2015 +0000
+++ b/zs_test.go	Sun Aug 30 12:20:35 2015 +0000
@@ -6,10 +6,8 @@
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"strings"
 	"testing"
-	"text/template"
 )
 
 func TestSplit2(t *testing.T) {
@@ -78,7 +76,7 @@
 
 func TestRender(t *testing.T) {
 	vars := map[string]string{"foo": "bar"}
-	funcs := template.FuncMap{
+	funcs := Funcs{
 		"greet": func(s ...string) string {
 			if len(s) == 0 {
 				return "hello"
@@ -138,24 +136,6 @@
 	}
 }
 
-func TestEvalCommand(t *testing.T) {
-	s, err := eval([]string{"echo", "hello"}, map[string]string{})
-	if err != nil {
-		t.Error(err)
-	}
-	if s != "hello\n" {
-		t.Error(s)
-	}
-	_, err = eval([]string{"cat", "bogus/file"}, map[string]string{})
-	if _, ok := err.(*exec.ExitError); !ok {
-		t.Error("expected ExitError")
-	}
-	_, err = eval([]string{"missing command"}, map[string]string{})
-	if err != nil {
-		t.Error("missing command should be ignored")
-	}
-}
-
 func TestHelperProcess(*testing.T) {
 	if os.Getenv("ZS_HELPER") != "1" {
 		return