zotero/test/tests/zoteroTest.js
Dan Stillman c7fd46e6b4 Don't ignore whitespace when sorting
Intl.Collator's ignorePunctuation ignores whitespace too, so stop using
it, since it produces much weirder results than sorting on punctuation does.
2017-11-16 01:17:24 -05:00

30 lines
841 B
JavaScript

"use strict";
describe("Zotero", function() {
describe("#getString()", function () {
it("should return the right plural form", function* () {
if (Zotero.locale != 'en-US') {
this.skip();
}
Components.utils.import("resource://gre/modules/PluralForm.jsm");
var str1 = Zotero.getString('fileInterface.itemsWereImported')
.split(/;/)[1]
.replace('%1$S', 2);
var str2 = Zotero.getString('fileInterface.itemsWereImported', 2, 2);
Zotero.debug(str1);
Zotero.debug(str2);
assert.equal(str1, str2);
});
});
describe("#localeCompare", function () {
it("shouldn't ignore whitespace", function () {
assert.equal(Zotero.localeCompare("Chang", "Chan H"), 1);
});
it("shouldn't ignore leading punctuation", function () {
assert.equal(Zotero.localeCompare("_Abcd", "Abcd"), -1);
});
});
});