| Akron | 0c4cd22 | 2019-07-19 16:33:34 +0200 | [diff] [blame] | 1 | define(['util'], function () { | 
|  | 2 | describe('KorAP.util', function () { | 
|  | 3 |  | 
|  | 4 | it('should quote', function () { | 
|  | 5 | expect('Baum'.quote()).toEqual('"Baum"'); | 
|  | 6 | expect('B"a"um'.quote()).toEqual('"B\\"a\\"um"'); | 
|  | 7 | }); | 
|  | 8 |  | 
|  | 9 | it('should escape regex', function () { | 
|  | 10 | expect('aaa/bbb\/ccc'.escapeRegex()).toEqual('aaa\\/bbb\\/ccc'); | 
|  | 11 | }); | 
|  | 12 |  | 
|  | 13 | it('should slugify', function () { | 
|  | 14 | expect('/korap/test'.slugify()).toEqual('koraptest'); | 
|  | 15 | expect('korap test'.slugify()).toEqual('korap-test'); | 
|  | 16 | expect('Korap Test'.slugify()).toEqual('korap-test'); | 
|  | 17 | }); | 
|  | 18 | }) | 
|  | 19 | }); |