From: Kārlis Gaņģis Date: Tue, 7 Jun 2016 09:07:51 +0000 (+0300) Subject: Added tests for LV locale X-Git-Tag: 2.14.0~28^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7586fa2139596aba8eae6bf55b6dac1e552cebed;p=thirdparty%2Fmoment.git Added tests for LV locale --- diff --git a/src/test/locale/lv.js b/src/test/locale/lv.js index a3ecabd4a..43d54ae7a 100644 --- a/src/test/locale/lv.js +++ b/src/test/locale/lv.js @@ -155,6 +155,12 @@ test('from', function (assert) { assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'gads', '1 year = a year'); assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 gadi', '5 years = 5 years'); assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), false), 'pirms 5 gadiem', '5 years with suffix = 5 years ago'); + + // test that numbers ending with 1 are singular except for when they end with 11 in which case they are plural + assert.equal(start.from(moment([2007, 1, 28]).add({y: 11}), true), '11 gadi', '11 years = 11 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 21}), true), '21 gads', '21 year = 21 year'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 211}), true), '211 gadi', '211 years = 211 years'); + assert.equal(start.from(moment([2007, 1, 28]).add({y: 221}), false), 'pirms 221 gada', '221 year with suffix = 221 years ago'); }); test('suffix', function (assert) {