Skip to content

Commit 632ac5d

Browse files
committed
Fix unit tests for slugger
1 parent 5c926e2 commit 632ac5d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/unit/marked-spec.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ describe('Test slugger functionality', function() {
2828
expect(slugger.slug('test')).toBe('test-2');
2929
});
3030

31-
it('should be unique to avoid collisions 1401', function() {
31+
it('should be unique when slug ends with number', function() {
32+
var slugger = new marked.Slugger();
33+
expect(slugger.slug('test 1')).toBe('test-1');
34+
expect(slugger.slug('test')).toBe('test');
35+
expect(slugger.slug('test')).toBe('test-2');
36+
});
37+
38+
it('should be unique when slug ends with hyphen number', function() {
3239
var slugger = new marked.Slugger();
3340
expect(slugger.slug('foo')).toBe('foo');
3441
expect(slugger.slug('foo')).toBe('foo-1');

0 commit comments

Comments
 (0)