@@ -7,10 +7,12 @@ import (
77 "io/ioutil"
88 "os"
99 "path/filepath"
10+ "runtime"
1011 "strings"
1112 "testing"
1213
1314 "github.com/go-task/task/v2"
15+ _ "github.com/go-task/task/v2/internal/homefix"
1416 "github.com/go-task/task/v2/internal/taskfile"
1517
1618 "github.com/mitchellh/go-homedir"
@@ -608,13 +610,16 @@ func TestSummary(t *testing.T) {
608610 }
609611 assert .NoError (t , e .Setup ())
610612 assert .NoError (t , e .Run (context .Background (), taskfile.Call {Task : "task-with-summary" }, taskfile.Call {Task : "other-task-with-summary" }))
611- assert .Equal (t , readTestFixture (t , dir , "task-with-summary.txt" ), buff .String ())
612- }
613613
614- func readTestFixture (t * testing.T , dir string , file string ) string {
615- b , err := ioutil .ReadFile (dir + "/" + file )
616- assert .NoError (t , err , "error reading text fixture" )
617- return string (b )
614+ data , err := ioutil .ReadFile (filepath .Join (dir , "task-with-summary.txt" ))
615+ assert .NoError (t , err )
616+
617+ expectedOutput := string (data )
618+ if runtime .GOOS == "windows" {
619+ expectedOutput = strings .Replace (expectedOutput , "\r \n " , "\n " , - 1 )
620+ }
621+
622+ assert .Equal (t , expectedOutput , buff .String ())
618623}
619624
620625func TestWhenNoDirAttributeItRunsInSameDirAsTaskfile (t * testing.T ) {
0 commit comments