From fd73b865f050826c0ccdf2a7e86c1fff007d5042 Mon Sep 17 00:00:00 2001 From: Gordey Doronin Date: Tue, 20 Apr 2021 18:06:00 +0200 Subject: [PATCH] [WIP] fix: Special characters --- test/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/index.js b/test/index.js index 0c14c27..2fbaf7b 100644 --- a/test/index.js +++ b/test/index.js @@ -205,6 +205,16 @@ describe('github-url-to-object', function () { assert.equal(obj.branch, '2.1') }) + it('resolves URLS for branches containing special characters', function () { + var obj = gh('https://github.com/zeke/outlet/tree/%3D%40') + assert.equal(obj.branch, '=@') + }) + + it('resolves URLS for branches containing special characters following after normal one', function () { + var obj = gh('https://github.com/zeke/outlet/tree/v%3D%40') + assert.equal(obj.branch, 'v=@') + }) + it('resolves blob-style URLS for branches other than master', function () { var obj = gh('https://github.com/zeke/ord/blob/new-style/.gitignore') assert.equal(obj.branch, 'new-style')