commit bbb6434524e9b4e8604cad5eb4ffbcbe9fe718a5
parent bb1cbdff269383294f9525b8bed3e3cda03fe82b
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 7 Nov 2017 16:53:31 -0500
Add test for short DOI parsing
Follow-up to #1356
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/test/tests/utilitiesTest.js b/test/tests/utilitiesTest.js
@@ -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);
});