MCPcopy
hub / github.com/lmorg/murex / TestDefaultProfileCompiles

Function TestDefaultProfileCompiles

defaults_test.go:28–63  ·  view source on GitHub ↗

TestDefaultProfileCompiles test the builtin murex_profile compiles

(t *testing.T)

Source from the content-addressed store, hash-verified

26
27// TestDefaultProfileCompiles test the builtin murex_profile compiles
28func TestDefaultProfileCompiles(t *testing.T) {
29 count.Tests(t, 1)
30
31 defaults.Config(config.InitConf, false)
32 lang.InitEnv()
33 lang.ShellProcess.Config = config.InitConf
34
35 var block string
36 for _, profile := range defaults.DefaultProfiles {
37 block += "\n\n" + string(profile.Block)
38 }
39
40 fork := lang.ShellProcess.Fork(lang.F_NO_STDIN | lang.F_NO_STDOUT | lang.F_CREATE_STDERR)
41 exitNum, err := fork.Execute([]rune(block))
42
43 if err != nil {
44 t.Error("Error compiling murex_profile:")
45 t.Log(err)
46 }
47
48 b, err := fork.Stderr.ReadAll()
49 if err != nil {
50 t.Error("Error reading from streams.Stdin (stderr):")
51 t.Log(err)
52 }
53
54 if len(b) > 0 {
55 t.Error("Uncaptured stderr content:")
56 t.Log(string(b))
57 }
58
59 if exitNum != 0 {
60 t.Error("Non-zero exit number:")
61 t.Log(exitNum)
62 }
63}

Callers

nothing calls this directly

Calls 7

TestsFunction · 0.92
ConfigFunction · 0.92
InitEnvFunction · 0.92
ForkMethod · 0.80
ExecuteMethod · 0.80
ErrorMethod · 0.65
ReadAllMethod · 0.65

Tested by

no test coverage detected