aboutsummaryrefslogtreecommitdiff
path: root/test/shared/urls.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/shared/urls.test.ts')
-rw-r--r--test/shared/urls.test.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/shared/urls.test.ts b/test/shared/urls.test.ts
index 3a3eea6..d6f0550 100644
--- a/test/shared/urls.test.ts
+++ b/test/shared/urls.test.ts
@@ -36,6 +36,19 @@ describe("shared/commands/parsers", () => {
expect(parsers.searchUrl('std::vector', config))
.to.equal('https://google.com/search?q=std%3A%3Avector');
});
+
+ it('localhost urls', () => {
+ expect(parsers.searchUrl('localhost', config))
+ .to.equal('http://localhost');
+ expect(parsers.searchUrl('http://localhost', config))
+ .to.equal('http://localhost');
+ expect(parsers.searchUrl('localhost:8080', config))
+ .to.equal('http://locahost:8080');
+ expect(parsers.searchUrl('localhost:80nan', config))
+ .to.equal('https://google.com/search?q=localhost:80nan');
+ expect(parsers.searchUrl('localhost 8080', config))
+ .to.equal('https://google.com/search?q=localhost%208080');
+ })
});
describe('#normalizeUrl', () => {
@@ -47,4 +60,3 @@ describe("shared/commands/parsers", () => {
});
});
});
-