8784: Fix test for latest firefox.
[arvados.git] / services / crunch-dispatch-slurm / script_test.go
1 package main
2
3 import (
4         . "gopkg.in/check.v1"
5 )
6
7 var _ = Suite(&ScriptSuite{})
8
9 type ScriptSuite struct{}
10
11 func (s *ScriptSuite) TestExecScript(c *C) {
12         for _, test := range []struct {
13                 args   []string
14                 script string
15         }{
16                 {nil, `exec`},
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" + `'`},
20         } {
21                 c.Logf("%+v -> %+v", test.args, test.script)
22                 c.Check(execScript(test.args), Equals, "#!/bin/sh\n"+test.script+"\n")
23         }
24 }