Skip to content

Commit

Permalink
Add test for short DOI parsing
Browse files Browse the repository at this point in the history
Follow-up to zotero#1356
  • Loading branch information
dstillman committed Nov 7, 2017
1 parent bb1cbdf commit bbb6434
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/tests/utilitiesTest.js
Expand Up @@ -37,11 +37,16 @@ describe("Zotero.Utilities", function() {
describe("#cleanDOI()", function () {
var cleanDOI = Zotero.Utilities.cleanDOI;
var doi = '10.1088/1748-9326/11/4/048002';
var shortDOI = '10/aabbe';

it("should parse a DOI", function () {
assert.equal(cleanDOI(`${doi}`), doi);
});

it("should parse a short DOI", function () {
assert.equal(cleanDOI(`${shortDOI}`), shortDOI);
});

it("should parse a DOI at the end of a sentence", function () {
assert.equal(cleanDOI(`Foo bar ${doi}. Foo bar`), doi);
});
Expand Down

0 comments on commit bbb6434

Please sign in to comment.