Changeset 6 in code for trunk/zs_test.go
- Timestamp:
- Dec 5, 2014, 6:21:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zs_test.go
r5 r6 6 6 "log" 7 7 "os" 8 "os/exec" 8 9 "strings" 9 10 "testing" … … 124 125 } 125 126 127 func TestEvalCommand(t *testing.T) { 128 s, err := eval([]string{"echo", "hello"}, map[string]string{}) 129 if err != nil { 130 t.Error(err) 131 } 132 if s != "hello\n" { 133 t.Error(s) 134 } 135 _, err = eval([]string{"cat", "bogus/file"}, map[string]string{}) 136 if _, ok := err.(*exec.ExitError); !ok { 137 t.Error("expected ExitError") 138 } 139 _, err = eval([]string{"missing command"}, map[string]string{}) 140 if err != nil { 141 t.Error("missing command should be ignored") 142 } 143 } 144 126 145 func TestHelperProcess(*testing.T) { 127 146 if os.Getenv("ZS_HELPER") != "1" {
Note:
See TracChangeset
for help on using the changeset viewer.