Skip to content

Commit 7b211ee

Browse files
committed
Add default Italian tests
1 parent 2143056 commit 7b211ee

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

  • lib/node_modules/@stdlib/nlp/ordinalize/test

lib/node_modules/@stdlib/nlp/ordinalize/test/test.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,63 @@ tape( 'the function returns an ordinal string for a provided integer string (lan
647647
t.end();
648648
});
649649

650+
tape( 'the function returns an ordinal string for a provided integer string (lang=it)', function test( t ) {
651+
var expected;
652+
var values;
653+
var opts;
654+
var i;
655+
656+
values = [
657+
'1',
658+
'2',
659+
'21',
660+
'7',
661+
'10',
662+
'11',
663+
'12',
664+
'13',
665+
'14',
666+
'15',
667+
'16',
668+
'21',
669+
'22',
670+
'23',
671+
'24',
672+
'332',
673+
'333',
674+
'999'
675+
];
676+
expected = [
677+
'1º',
678+
'2º',
679+
'21º',
680+
'7º',
681+
'10º',
682+
'11º',
683+
'12º',
684+
'13º',
685+
'14º',
686+
'15º',
687+
'16º',
688+
'21º',
689+
'22º',
690+
'23º',
691+
'24º',
692+
'332º',
693+
'333º',
694+
'999º'
695+
];
696+
697+
opts = {
698+
'lang': 'it'
699+
};
700+
701+
for ( i = 0; i < values.length; i++ ) {
702+
t.equal( ordinalize( values[i], opts ), expected[i], 'returns expected value' );
703+
}
704+
t.end();
705+
});
706+
650707
tape( 'the function returns an ordinal string for a provided integer string (lang=it, gender=masculine)', function test( t ) {
651708
var expected;
652709
var values;

0 commit comments

Comments
 (0)