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:
zaitsev.serge
2015-08-30 12:20:35 +00:00
parent d58b49fed3
commit 10854b5124
4 changed files with 278 additions and 213 deletions

View File

@@ -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