Skip to content

Commit

Permalink
Add Vietnamese characters test
Browse files Browse the repository at this point in the history
  • Loading branch information
dominhhai committed Apr 13, 2015
1 parent eb1eed0 commit d756ec9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/slug.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ describe 'slug', ->
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]

it 'should replace vietnamese chars', ->
char_map = {
'': 'A', '': 'A', '': 'A', '': 'A', '': 'A', '': 'A', '': 'A',
'': 'A', '': 'A', '': 'A', '': 'A', '': 'A', '': 'E', '': 'E',
'': 'E', '': 'E', '': 'E', '': 'E', '': 'E', '': 'E', '': 'I',
'': 'I', 'Ĩ': 'I', '': 'O', '': 'O', '': 'O', '': 'O', '': 'O',
'': 'O', '': 'O', 'Ơ': 'O', '': 'O', '': 'O', '': 'O', '': 'O',
'': 'O', '': 'U', '': 'U', 'Ũ': 'U', 'Ư': 'U', '': 'U', '': 'U',
'': 'U', '': 'U', '': 'U', '': 'Y', '': 'Y', '': 'Y', '': 'Y',
'Đ': 'D', '': 'a', '': 'a', '': 'a', '': 'a', '': 'a', '': 'a',
'': 'a', '': 'a', '': 'a', '': 'a', '': 'a', '': 'a', '': 'e',
'': 'e', '': 'e', '': 'e', 'ế': 'e', '': 'e', '': 'e', '': 'e',
'': 'i', '': 'i', 'ĩ': 'i', '': 'o', '': 'o', '': 'o', '': 'o',
'': 'o', '': 'o', '': 'o', 'ơ': 'o', '': 'o', '': 'o', '': 'o',
'': 'o', '': 'o', '': 'u', '': 'u', 'ũ': 'u', 'ư': 'u', '': 'u',
'': 'u', '': 'u', '': 'u', '': 'u', '': 'y', '': 'y', '': 'y',
'': 'y', 'đ': 'd'
}
for char, replacement of char_map
[slug "foo #{char} bar baz"].should.eql ["foo-#{replacement}-bar-baz"]

it 'should replace currencies', ->
char_map = {
Expand Down

0 comments on commit d756ec9

Please sign in to comment.