Skip to content

Commit

Permalink
Update test runner to forgive variant context strings in Error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Jun 5, 2011
1 parent b4127a8 commit edc5948
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/test/run.js
Expand Up @@ -34,9 +34,23 @@ function runOneSync(name, selname, p) {
}); });
} catch(e) { } catch(e) {
got = e.toString(); 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";
} }




Expand Down

0 comments on commit edc5948

Please sign in to comment.