TestDefaultProfileCompiles test the builtin murex_profile compiles
(t *testing.T)
| 26 | |
| 27 | // TestDefaultProfileCompiles test the builtin murex_profile compiles |
| 28 | func 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 | } |