Skip to content

Commit

Permalink
Single character cases
Browse files Browse the repository at this point in the history
  • Loading branch information
gordey4doronin committed Apr 21, 2021
1 parent fd73b86 commit dab8d56
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/index.js
Expand Up @@ -205,14 +205,24 @@ describe('github-url-to-object', function () {
assert.equal(obj.branch, '2.1')
})

it('resolves URLS for branches with single character names', function () {
var obj = gh('https://github.com/zeke/outlet/tree/q')
assert.strictEqual(obj.branch, 'q')
})

it('resolves URLS for branches with single digit names', function () {
var obj = gh('https://github.com/zeke/outlet/tree/0')
assert.strictEqual(obj.branch, '0')
})

it('resolves URLS for branches containing special characters', function () {
var obj = gh('https://github.com/zeke/outlet/tree/%3D%40')
assert.equal(obj.branch, '=@')
assert.strictEqual(obj.branch, '%3D%40')
})

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=@')
assert.strictEqual(obj.branch, 'v%3D%40')
})

it('resolves blob-style URLS for branches other than master', function () {
Expand Down

0 comments on commit dab8d56

Please sign in to comment.