Skip to content

Commit

Permalink
fix the connect error test, by making it more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
ssinghi authored and Sannis committed Aug 14, 2010
1 parent df07444 commit 8e49d63
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions tests/test-class-mysqlconn.js
Expand Up @@ -104,10 +104,7 @@ exports.ConnectError = function (test) {

error_str = conn.connectError();

if ((error_str === "Access denied for user '" + cfg.user + "'@'" + cfg.host +
"' to database '" + cfg.database_denied + "'") ||
(error_str === "Access denied for user ''@'" + cfg.host +
"' to database '" + cfg.database_denied + "'")) {
if (error_str.match(new RegExp("Access denied for user '" + cfg.user + "'\@'.*' to database \'" + cfg.database_denied + "\'"))) {
test.ok(true, "conn.connectError()");
} else {
test.ok(false, "conn.connectError()");
Expand Down

0 comments on commit 8e49d63

Please sign in to comment.