]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Added tests for LV locale
authorKārlis Gaņģis <karlis@zoomcharts.com>
Tue, 7 Jun 2016 09:07:51 +0000 (12:07 +0300)
committerIskren Chernev <iskren.chernev@gmail.com>
Tue, 14 Jun 2016 09:12:56 +0000 (02:12 -0700)
src/test/locale/lv.js

index a3ecabd4a519e5aeed70dcfe42fdde1fac4ecede..43d54ae7ada4666b567221241b5a40c6b8328624 100644 (file)
@@ -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) {