MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / RunTaskCase

Function RunTaskCase

test/tool/tool.go:55–72  ·  view source on GitHub ↗
(t *testing.T, sca ...sca.Sca)

Source from the content-addressed store, hash-verified

53}
54
55func RunTaskCase(t *testing.T, sca ...sca.Sca) func(cases []TaskCase) {
56 return func(cases []TaskCase) {
57 for _, c := range cases {
58 r := opensca.RunTask(context.Background(), &opensca.TaskArg{
59 DataOrigin: c.Path,
60 Sca: sca,
61 })
62 result := &model.DepGraph{}
63 for _, dep := range r.Deps {
64 result.AppendChild(dep)
65 }
66 if Diff(result, c.Result) {
67 logs.Debugf("%s\nres:\n%sstd:\n%s", c.Path, result.Tree(false, true), c.Result.Tree(false, true))
68 t.Fail()
69 }
70 }
71 }
72}

Callers 7

Test_PythonFunction · 0.92
Test_PhpFunction · 0.92
Test_RubyFunction · 0.92
Test_RustFunction · 0.92
Test_JavaScriptFunction · 0.92
Test_JavaWithStaticFunction · 0.92
Test_JavaWithMvnFunction · 0.92

Calls 5

AppendChildMethod · 0.95
TreeMethod · 0.95
RunTaskFunction · 0.92
DebugfFunction · 0.92
DiffFunction · 0.85

Tested by 7

Test_PythonFunction · 0.74
Test_PhpFunction · 0.74
Test_RubyFunction · 0.74
Test_RustFunction · 0.74
Test_JavaScriptFunction · 0.74
Test_JavaWithStaticFunction · 0.74
Test_JavaWithMvnFunction · 0.74