Permalink
Browse files

Update test runner to forgive variant context strings in Error messages

  • Loading branch information...
1 parent b4127a8 commit edc594860778e12416f3de4891c43476731f7e55 @rwaldron rwaldron committed Jun 5, 2011
Showing with 16 additions and 2 deletions.
  1. +16 −2 src/test/run.js
View
@@ -34,9 +34,23 @@ function runOneSync(name, selname, p) {
});
} catch(e) {
got = e.toString();
- if (want.trim() != got.trim()) throw e;
+ if (want.trim() != got.trim()) {
+
+ // The error messages will have consistent prefix strings, but variant context strings
+ if ( want.trim().indexOf("Error") === -1 && got.trim().indexOf( want.trim() ) !== 0 ) {
+ throw e;
+ }
+ //console.log( "want: " + want.trim() );
+ //console.log( "got: " + got.trim() );
+ }
+ }
+ if (want.trim() != got.trim()) {
+ //console.log( "want: " + want.trim() );
+ //console.log( "got: " + got.trim() );
+ if ( want.trim().indexOf("Error") === -1 && got.trim().indexOf( want.trim() ) !== 0 ) {
+ throw "mismatch";
+ }
}
- if (want.trim() != got.trim()) throw "mismatch";
}

0 comments on commit edc5948

Please sign in to comment.