test-run-tests: accept more levels of precision and trailing ws (issue4440) stable
authorAugie Fackler <raf@durin42.com>
Thu, 06 Nov 2014 10:57:13 -0500
branchstable
changeset 23245 d33a90cb2a32
parent 23232 a0ccb66f344d
child 23246 643c58303fb0
test-run-tests: accept more levels of precision and trailing ws (issue4440) simplejson produces slightly different output from the built-in json module, specifically: * It uses 0.000 instead of 0.0000 * It likes to put a trailing space after a comma This change works around both of those variations.
tests/test-run-tests.t
--- a/tests/test-run-tests.t	Wed Nov 05 21:33:45 2014 -0500
+++ b/tests/test-run-tests.t	Thu Nov 06 10:57:13 2014 -0500
@@ -416,22 +416,22 @@
   $ cat report.json
   testreport ={
       "test-failure.t": [\{] (re)
-          "csys": "\s*[\d\.]{5}",  (re)
-          "cuser": "\s*[\d\.]{5}",  (re)
-          "result": "failure", 
-          "time": "\s*[\d\.]{5}" (re)
-      }, 
+          "csys": "\s*[\d\.]{4,5}", ? (re)
+          "cuser": "\s*[\d\.]{4,5}", ? (re)
+          "result": "failure", ? (re)
+          "time": "\s*[\d\.]{4,5}" (re)
+      }, ? (re)
       "test-skip.t": {
-          "csys": "\s*[\d\.]{5}",  (re)
-          "cuser": "\s*[\d\.]{5}",  (re)
-          "result": "skip", 
-          "time": "\s*[\d\.]{5}" (re)
-      }, 
+          "csys": "\s*[\d\.]{4,5}", ? (re)
+          "cuser": "\s*[\d\.]{4,5}", ? (re)
+          "result": "skip", ? (re)
+          "time": "\s*[\d\.]{4,5}" (re)
+      }, ? (re)
       "test-success.t": [\{] (re)
-          "csys": "\s*[\d\.]{5}",  (re)
-          "cuser": "\s*[\d\.]{5}",  (re)
-          "result": "success", 
-          "time": "\s*[\d\.]{5}" (re)
+          "csys": "\s*[\d\.]{4,5}", ? (re)
+          "cuser": "\s*[\d\.]{4,5}", ? (re)
+          "result": "success", ? (re)
+          "time": "\s*[\d\.]{4,5}" (re)
       }
   } (no-eol)