github.com/swaros/contxt/module/taskrun@v0.0.0-20240305083542-3dbd4436ac40/export_test.go (about)

     1  package taskrun_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/swaros/contxt/module/taskrun"
     7  )
     8  
     9  func TestExport(t *testing.T) {
    10  	folderRunner("./../../docs/test/01multi", t, func(t *testing.T) {
    11  		cmdLine, err := taskrun.ExportTask("task")
    12  		if err != nil {
    13  			t.Error(err)
    14  		}
    15  
    16  		if cmdLine == "" {
    17  			t.Error("unexpected empty result")
    18  		}
    19  		xpectedCmdLine := `echo "hello 1"
    20          echo "hello 2"
    21  `
    22  		if clearStrings(cmdLine) != clearStrings(xpectedCmdLine) {
    23  			t.Error("not equals [", clearStrings(xpectedCmdLine), "] and [", clearStrings(cmdLine), "]")
    24  		}
    25  
    26  	})
    27  }