@@ -279,9 +279,7 @@ def HasRun(self, output):
279279 # hard to decipher what test is running when only the filename is printed.
280280 prefix = abspath (join (dirname (__file__ ), '../test' )) + os .sep
281281 command = output .command [- 1 ]
282- if command .endswith ('.js' ): command = command [:- 3 ]
283- if command .startswith (prefix ): command = command [len (prefix ):]
284- command = command .replace ('\\ ' , '/' )
282+ command = NormalizePath (command , prefix )
285283
286284 if output .UnexpectedOutput ():
287285 status_line = 'not ok %i %s' % (self ._done , command )
@@ -352,9 +350,7 @@ def HasRun(self, output):
352350 # hard to decipher what test is running when only the filename is printed.
353351 prefix = abspath (join (dirname (__file__ ), '../test' )) + os .sep
354352 command = output .command [- 1 ]
355- if command .endswith ('.js' ): command = command [:- 3 ]
356- if command .startswith (prefix ): command = command [len (prefix ):]
357- command = command .replace ('\\ ' , '/' )
353+ command = NormalizePath (command , prefix )
358354
359355 stdout = output .output .stdout .strip ()
360356 printed_file = False
@@ -1497,12 +1493,16 @@ def SplitPath(s):
14971493 stripped = [ c .strip () for c in s .split ('/' ) ]
14981494 return [ Pattern (s ) for s in stripped if len (s ) > 0 ]
14991495
1500- def NormalizePath (path ):
1496+ def NormalizePath (path , prefix = 'test/' ):
15011497 # strip the extra path information of the specified test
1502- if path .startswith ('test/' ):
1503- path = path [5 :]
1498+ prefix = prefix .replace ('\\ ' , '/' )
1499+ path = path .replace ('\\ ' , '/' )
1500+ if path .startswith (prefix ):
1501+ path = path [len (prefix ):]
15041502 if path .endswith ('.js' ):
15051503 path = path [:- 3 ]
1504+ elif path .endswith ('.mjs' ):
1505+ path = path [:- 4 ]
15061506 return path
15071507
15081508def GetSpecialCommandProcessor (value ):
0 commit comments