@@ -3,13 +3,14 @@ package engine
33import (
44 "bytes"
55 "context"
6- "mvdan.cc/sh/v3/expand "
6+ "fmt "
77 "os"
88 "path/filepath"
99 "strings"
1010 "testing"
11-
11+
1212 "gotest.tools/assert"
13+ "mvdan.cc/sh/v3/expand"
1314)
1415
1516type testCaseShell struct {
@@ -23,11 +24,11 @@ func TestShellCat(t *testing.T) {
2324 t .Fatal (err )
2425 }
2526 defer os .Remove (file .Name ())
26-
27+
2728 if _ , err = file .WriteString ("Hello DevSpace!" ); err != nil {
2829 t .Fatalf ("Unable to write to temporary file %v" , err )
2930 }
30-
31+
3132 testCases := []testCaseShell {
3233 {
3334 command : "cat " + filepath .ToSlash (file .Name ()),
@@ -38,7 +39,7 @@ func TestShellCat(t *testing.T) {
3839 expectedOutput : "123\n " ,
3940 },
4041 }
41-
42+
4243 for _ , testCase := range testCases {
4344 stdout := & bytes.Buffer {}
4445 err := ExecuteSimpleShellCommand (context .Background (), "." , expand .ListEnviron (os .Environ ()... ), stdout , nil , nil , testCase .command )
@@ -56,7 +57,7 @@ func TestShellCatError(t *testing.T) {
5657 expectedOutput : "cat: noFile.txt: No such file or directory\n " ,
5758 },
5859 }
59-
60+
6061 for _ , testCase := range testCases {
6162 stderr := & bytes.Buffer {}
6263 err := ExecuteSimpleShellCommand (context .Background (), "." , expand .ListEnviron (os .Environ ()... ), stderr , stderr , nil , testCase .command )
@@ -69,7 +70,7 @@ func TestShellCatError(t *testing.T) {
6970 } else {
7071 t .Fatal ("FAIL: TestShellCatError" )
7172 }
72-
73+
7374 }
7475}
7576
@@ -80,11 +81,11 @@ func TestShellCatEnforce(t *testing.T) {
8081 t .Fatal (err )
8182 }
8283 defer os .Remove (file .Name ())
83-
84+
8485 if _ , err = file .WriteString ("Hello DevSpace!" ); err != nil {
8586 t .Fatalf ("Unable to write to temporary file %v" , err )
8687 }
87-
88+
8889 testCases := []testCaseShell {
8990 {
9091 command : "cat " + filepath .ToSlash (file .Name ()),
@@ -95,7 +96,7 @@ func TestShellCatEnforce(t *testing.T) {
9596 expectedOutput : "123\n " ,
9697 },
9798 }
98-
99+
99100 for _ , testCase := range testCases {
100101 stdout := & bytes.Buffer {}
101102 err := ExecuteSimpleShellCommand (context .Background (), "." , expand .ListEnviron (os .Environ ()... ), stdout , nil , nil , testCase .command )
@@ -132,5 +133,8 @@ func TestHelmDownload(t *testing.T) {
132133 if err != nil {
133134 t .Fatal (err )
134135 }
136+
137+ fmt .Println ("👉:" , stdout1 .String ())
138+
135139 assert .Assert (t , strings .Contains (stdout1 .String (), `Version:"v4` ))
136140}
0 commit comments