Skip to content

Commit

Permalink
Expand tests for formatnum
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Jan 14, 2021
1 parent 288e306 commit 92688de
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions test/banana.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,23 @@ describe('Banana', function () {
})

it('should parse formatnum', () => {
let locale = 'hi'
const banana = new Banana(locale)
const bananaHi = new Banana('hi')
assert.strictEqual(
banana.i18n('{{formatnum:34242}}'),
bananaHi.i18n('{{formatnum:34242}}'),
'३४२४२',
'Devanagiri numerals'
'Gives Devanagiri numerals with locale=hi'
)
const bananaEn = new Banana('en')
assert.strictEqual(
bananaEn.i18n('{{formatnum:34242}}'),
'34242',
'Gives Hindu–Arabic numerals with locale=en'
)
const bananaFa = new Banana('fa')
assert.strictEqual(
bananaFa.i18n('{{formatnum:42}}'),
'۴۲',
'Gives Persian numerals with locale=fa'
)
})

Expand Down

0 comments on commit 92688de

Please sign in to comment.