@@ -191,7 +191,10 @@ func TestListMagefilesMain(t *testing.T) {
191
191
if err != nil {
192
192
t .Errorf ("error from magefile list: %v: %s" , err , buf )
193
193
}
194
- expected := []string {"testdata/mixed_main_files/mage_helpers.go" , "testdata/mixed_main_files/magefile.go" }
194
+ expected := []string {
195
+ filepath .FromSlash ("testdata/mixed_main_files/mage_helpers.go" ),
196
+ filepath .FromSlash ("testdata/mixed_main_files/magefile.go" ),
197
+ }
195
198
if ! reflect .DeepEqual (files , expected ) {
196
199
t .Fatalf ("expected %q but got %q" , expected , files )
197
200
}
@@ -211,9 +214,9 @@ func TestListMagefilesIgnoresGOOS(t *testing.T) {
211
214
}
212
215
var expected []string
213
216
if runtime .GOOS == "windows" {
214
- expected = []string {"testdata/goos_magefiles/magefile_windows.go" }
217
+ expected = []string {filepath . FromSlash ( "testdata/goos_magefiles/magefile_windows.go" ) }
215
218
} else {
216
- expected = []string {"testdata/goos_magefiles/magefile_nonwindows.go" }
219
+ expected = []string {filepath . FromSlash ( "testdata/goos_magefiles/magefile_nonwindows.go" ) }
217
220
}
218
221
if ! reflect .DeepEqual (files , expected ) {
219
222
t .Fatalf ("expected %q but got %q" , expected , files )
@@ -235,9 +238,9 @@ func TestListMagefilesIgnoresRespectsGOOSArg(t *testing.T) {
235
238
}
236
239
var expected []string
237
240
if goos == "windows" {
238
- expected = []string {"testdata/goos_magefiles/magefile_windows.go" }
241
+ expected = []string {filepath . FromSlash ( "testdata/goos_magefiles/magefile_windows.go" ) }
239
242
} else {
240
- expected = []string {"testdata/goos_magefiles/magefile_nonwindows.go" }
243
+ expected = []string {filepath . FromSlash ( "testdata/goos_magefiles/magefile_nonwindows.go" ) }
241
244
}
242
245
if ! reflect .DeepEqual (files , expected ) {
243
246
t .Fatalf ("expected %q but got %q" , expected , files )
@@ -307,7 +310,10 @@ func TestListMagefilesLib(t *testing.T) {
307
310
if err != nil {
308
311
t .Errorf ("error from magefile list: %v: %s" , err , buf )
309
312
}
310
- expected := []string {"testdata/mixed_lib_files/mage_helpers.go" , "testdata/mixed_lib_files/magefile.go" }
313
+ expected := []string {
314
+ filepath .FromSlash ("testdata/mixed_lib_files/mage_helpers.go" ),
315
+ filepath .FromSlash ("testdata/mixed_lib_files/magefile.go" ),
316
+ }
311
317
if ! reflect .DeepEqual (files , expected ) {
312
318
t .Fatalf ("expected %q but got %q" , expected , files )
313
319
}
@@ -1078,6 +1084,9 @@ func TestCompiledFlags(t *testing.T) {
1078
1084
t .Fatal (err )
1079
1085
}
1080
1086
name := filepath .Join (compileDir , "mage_out" )
1087
+ if runtime .GOOS == "windows" {
1088
+ name += ".exe"
1089
+ }
1081
1090
// The CompileOut directory is relative to the
1082
1091
// invocation directory, so chop off the invocation dir.
1083
1092
outName := "./" + name [len (dir )- 1 :]
@@ -1162,6 +1171,9 @@ func TestCompiledEnvironmentVars(t *testing.T) {
1162
1171
t .Fatal (err )
1163
1172
}
1164
1173
name := filepath .Join (compileDir , "mage_out" )
1174
+ if runtime .GOOS == "windows" {
1175
+ name += ".exe"
1176
+ }
1165
1177
// The CompileOut directory is relative to the
1166
1178
// invocation directory, so chop off the invocation dir.
1167
1179
outName := "./" + name [len (dir )- 1 :]
@@ -1251,6 +1263,9 @@ func TestCompiledVerboseFlag(t *testing.T) {
1251
1263
t .Fatal (err )
1252
1264
}
1253
1265
filename := filepath .Join (compileDir , "mage_out" )
1266
+ if runtime .GOOS == "windows" {
1267
+ filename += ".exe"
1268
+ }
1254
1269
// The CompileOut directory is relative to the
1255
1270
// invocation directory, so chop off the invocation dir.
1256
1271
outName := "./" + filename [len (dir )- 1 :]
0 commit comments