(dir string)
| 174 | } |
| 175 | |
| 176 | func getTestscriptParams(dir string) testscript.Params { |
| 177 | return testscript.Params{ |
| 178 | Dir: dir, |
| 179 | RequireExplicitExec: true, |
| 180 | TestWork: false, // Set to true if you're trying to debug a test. |
| 181 | Setup: func(env *testscript.Env) error { return setupTestEnv(env) }, |
| 182 | Cmds: map[string]func(ts *testscript.TestScript, neg bool, args []string){ |
| 183 | "cp": copyFileCmd, |
| 184 | "devboxjson.packages.contains": assertDevboxJSONPackagesContains, |
| 185 | "devboxlock.packages.contains": assertDevboxLockPackagesContains, |
| 186 | "env.path.len": assertPathLength, |
| 187 | "glob": globCmd, |
| 188 | "json.superset": assertJSONSuperset, |
| 189 | "path.order": assertPathOrder, |
| 190 | "source.path": sourcePath, |
| 191 | }, |
| 192 | Condition: func(cond string) (bool, error) { |
| 193 | before, key, found := strings.Cut(cond, ":") |
| 194 | if found && before == "env" { |
| 195 | if v, ok := os.LookupEnv(key); ok { |
| 196 | return strconv.ParseBool(v) |
| 197 | } |
| 198 | return false, nil |
| 199 | } |
| 200 | return false, fmt.Errorf("unknown condition: %v", cond) |
| 201 | }, |
| 202 | } |
| 203 | } |
no test coverage detected