Just change in generated formatting

This commit is contained in:
Mark Miller 2011-09-30 04:03:28 -04:00
parent 64db10aa2d
commit 68f00c57a3
2 changed files with 56 additions and 28 deletions

View File

@ -22,34 +22,62 @@
//An exception is expected
if (testDescrip.negative !== undefined) {
//TODO - come up with a generic way of catching the error type from this.onerror
//TODO - come up with a generic way of catching the error type
//from this.onerror
testDescrip.negative = testDescrip.negative === "NotEarlyError" ?
testDescrip.negative : (testDescrip.negative === "^((?!NotEarlyError).)*$" ?
testDescrip.negative :
(testDescrip.negative === "^((?!NotEarlyError).)*$" ?
testDescrip.negative : ".");
if (this.iframeError === undefined) { //no exception was thrown
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
testRun(testDescrip.id,
testDescrip.path,
testDescrip.description,
testDescrip.code,
'fail',
Error('No exception was thrown; expected an error "message" property matching the regular expression "' + testDescrip.negative + '".'));
} else if (!(new RegExp(testDescrip.negative, "i").test(this.iframeError))) { //wrong type of exception thrown
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
Error('No exception was thrown; expected an error "message"' +
' property matching the regular expression "' +
testDescrip.negative + '".'));
} else if (!(new RegExp(testDescrip.negative,
"i").test(this.iframeError))) {
//wrong type of exception thrown
testRun(testDescrip.id,
testDescrip.path,
testDescrip.description,
testDescrip.code,
'fail',
Error('Expected an exception with a "message" property matching the regular expression "' + testDescrip.negative +'" to be thrown; actual was "' + this.iframeError + '".'));
Error('Expected an exception with a "message"' +
' property matching the regular expression "' +
testDescrip.negative +
'" to be thrown; actual was "' +
this.iframeError + '".'));
} else {
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
'pass', undefined);
testRun(testDescrip.id,
testDescrip.path,
testDescrip.description,
testDescrip.code,
'pass',
undefined);
}
}
//Exception was not expected to be thrown
else if (this.iframeError !== undefined) {
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
testRun(testDescrip.id,
testDescrip.path,
testDescrip.description,
testDescrip.code,
'fail',
Error('Unexpected exception, "' + this.iframeError + '" was thrown.'));
Error('Unexpected exception, "' +
this.iframeError + '" was thrown.'));
}
else {
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
'pass', undefined);
testRun(testDescrip.id,
testDescrip.path,
testDescrip.description,
testDescrip.code,
'pass',
undefined);
}
testFinished();