-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsure.gen_test.go
38 lines (32 loc) · 1001 Bytes
/
sure.gen_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package osexec
import (
"testing"
"github.com/yyle88/runpath"
"github.com/yyle88/runpath/runtestpath"
"github.com/yyle88/sure"
"github.com/yyle88/sure/sure_cls_gen"
"github.com/yyle88/syntaxgo"
"github.com/yyle88/syntaxgo/syntaxgo_ast"
)
func TestGen(t *testing.T) {
options := sure_cls_gen.NewClassGenOptions(runpath.PARENT.Path()).
WithNewClassNameParts("88").
WithNamingPatternType(sure_cls_gen.STYLE_SUFFIX_CAMELCASE_TYPE).
MoreErrorHandlingModes(sure.MUST, sure.SOFT, sure.OMIT)
config := &sure_cls_gen.ClassGenConfig{
ClassGenOptions: options,
PackageName: syntaxgo.CurrentPackageName(),
ImportOptions: syntaxgo_ast.NewPackageImportOptions(),
OutputPath: runtestpath.SrcPath(t),
}
sure_cls_gen.GenerateClasses(config, CommandConfig{})
}
func TestCommandConfig88Must_Exec(t *testing.T) {
output := NewCommandConfig().
WithEnvs([]string{"A=1", "B=2"}).
WithDebugMode(true).
WithBash().
Must().
Exec("echo", "$A", "$B")
t.Log(string(output))
}