fixed output file names in html pages, fixed amber function bindings, replaced print command with build, fixed plugin functions, implemented zs and exec functions
git-svn-id: file:///srv/svn/repo/aya/trunk@24 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
22
zs_test.go
22
zs_test.go
@@ -6,10 +6,8 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
func TestSplit2(t *testing.T) {
|
||||
@@ -78,7 +76,7 @@ this: is a content`), Vars{})
|
||||
|
||||
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 TestRun(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user