7 var _ = Suite(&ScriptSuite{})
9 type ScriptSuite struct{}
11 func (s *ScriptSuite) TestExecScript(c *C) {
12 for _, test := range []struct {
17 {[]string{`foo`}, `exec 'foo'`},
18 {[]string{`foo`, `bar baz`}, `exec 'foo' 'bar baz'`},
19 {[]string{`foo"`, "'waz 'qux\n"}, `exec 'foo"' ''\''waz '\''qux` + "\n" + `'`},
21 c.Logf("%+v -> %+v", test.args, test.script)
22 c.Check(execScript(test.args), Equals, "#!/bin/sh\n"+test.script+"\n")