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.
--- 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)