Skip to content

Commit 3e70c45

Browse files
committed
test case for password containing a < or > sign
1 parent bb9cd85 commit 3e70c45

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/unit/utils-tests.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,17 @@ test('libpq connection string building', function() {
143143
}))
144144
})
145145

146+
test('password contains < and/or > characters', function () {
147+
var sourceConfig = {
148+
user:'brian',
149+
password: 'hello<ther>e',
150+
port: 5432,
151+
host: 'localhost',
152+
database: 'postgres'
153+
}
154+
var connectionString = 'pg://' + sourceConfig.user + ':' + sourceConfig.password + '@' + sourceConfig.host + ':' + sourceConfig.port + '/' + sourceConfig.database;
155+
var config = utils.parseConnectionString(connectionString);
156+
assert.same(config, sourceConfig);
157+
});
158+
146159
})

0 commit comments

Comments
 (0)