Index: trunk/phase3/tests/parser/parserTest.inc |
— | — | @@ -1063,7 +1063,9 @@ |
1064 | 1064 | * @return String |
1065 | 1065 | */ |
1066 | 1066 | protected function quickDiff( $input, $output, $inFileTail = 'expected', $outFileTail = 'actual' ) { |
1067 | | - $prefix = wfTempDir() . "/mwParser-" . mt_rand(); |
| 1067 | + # Windows, or at least the fc utility, is retarded |
| 1068 | + $slash = wfIsWindows() ? '\\' : '/'; |
| 1069 | + $prefix = wfTempDir() . "{$slash}mwParser-" . mt_rand(); |
1068 | 1070 | |
1069 | 1071 | $infile = "$prefix-$inFileTail"; |
1070 | 1072 | $this->dumpToFile( $input, $infile ); |
— | — | @@ -1071,7 +1073,12 @@ |
1072 | 1074 | $outfile = "$prefix-$outFileTail"; |
1073 | 1075 | $this->dumpToFile( $output, $outfile ); |
1074 | 1076 | |
1075 | | - $diff = `diff -au $infile $outfile`; |
| 1077 | + $shellInfile = wfEscapeShellArg($infile); |
| 1078 | + $shellOutfile = wfEscapeShellArg($outfile); |
| 1079 | + |
| 1080 | + $diff = wfIsWindows() |
| 1081 | + ? `fc $shellInfile $shellOutfile` |
| 1082 | + : `diff -au $shellInfile $shellOutfile`; |
1076 | 1083 | unlink( $infile ); |
1077 | 1084 | unlink( $outfile ); |
1078 | 1085 | |