Skip to content

Commit

Permalink
test(url parser): port tests for double colon and slash in host ident…
Browse files Browse the repository at this point in the history
…ifier

from #1559
  • Loading branch information
Jessica Lord committed Nov 29, 2017
1 parent 5cc4464 commit 1d30bf6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/functional/url_parser_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,4 +990,36 @@ describe('Url Parser', function() {
});
}
});

/**
* @ignore
*/
it('should raise exceptions on invalid hostnames with double colon in host identifier', {
metadata: {
requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] }
},
test: function(done) {
parse('mongodb://invalid::host:27017/db', {}, function(err) {
expect(err).to.exist;
expect(err.message).to.equal('Double colon in host identifier');
done();
});
}
});

/**
* @ignore
*/
it('should raise exceptions on invalid hostnames with slash in host identifier', {
metadata: {
requires: { topology: ['single', 'replicaset', 'sharded', 'ssl', 'heap', 'wiredtiger'] }
},
test: function(done) {
parse('mongodb://invalid/host:27017/db', {}, function(err) {
expect(err).to.exist;
expect(err.message).to.equal('Slash in host identifier');
done();
});
}
});
});

0 comments on commit 1d30bf6

Please sign in to comment.