1
- var marked = require ( '../../lib/marked.js' ) ;
2
- var cmSpec = require ( './commonmark.json' ) ;
1
+ var marked = require ( '../../../ lib/marked.js' ) ;
2
+ var cmSpec = require ( './commonmark.0.28. json' ) ;
3
3
var HtmlDiffer = require ( 'html-differ' ) . HtmlDiffer ,
4
4
htmlDiffer = new HtmlDiffer ( ) ;
5
5
var since = require ( 'jasmine2-custom-message' ) ;
@@ -11,42 +11,44 @@ Messenger.prototype.message = function(spec, expected, actual) {
11
11
}
12
12
13
13
Messenger . prototype . test = function ( spec , section , ignore ) {
14
- if ( spec . section === section && ignore . indexOf ( spec . example ) < 0 ) {
15
- it ( 'should pass example ' + spec . example , function ( ) {
14
+ if ( spec . section === section ) {
15
+ var shouldFail = ~ ignore . indexOf ( spec . example ) ;
16
+ it ( 'should ' + ( shouldFail ? 'fail' : 'pass' ) + ' example ' + spec . example , function ( ) {
16
17
var expected = spec . html ;
17
18
var actual = marked ( spec . markdown , { headerIds : false , xhtml : true } ) ;
18
19
since ( messenger . message ( spec , expected , actual ) ) . expect (
19
20
htmlDiffer . isEqual ( expected , actual )
20
- ) . toEqual ( true ) ;
21
+ ) . toEqual ( ! shouldFail ) ;
21
22
} ) ;
22
23
}
23
24
}
24
25
25
26
var messenger = new Messenger ( ) ;
26
27
/*
27
- |Section |Count |Percent |
28
- |:---------------------------|:-------:|---------:|
29
- |Tabs |7 of 11 |63% |
30
- |Thematic breaks |16 of 19 |84% |
31
- |ATX headings |13 of 18 |72% |
32
- |Setext headings |20 of 26 |77% |
33
- |Indented code blocks |11 of 12 |92% |
34
- |Fenced code blocks |17 of 28 |61% |
35
- |HTML blocks |12 of 43 |28% |
36
- |Link reference definitions |21 of 23 |91% |
37
- |Paragraphs |6 of 8 |75% |
38
- |Block quotes |21 of 25 |84% |
39
- |List items |32 of 48 |67% |
40
- |Lists |10 of 24 |42% |
41
- |Backslash escapes |4 of 13 |31% |
42
- |Entity and numeric character references|8 of 12|67%|
43
- |Code spans |10 of 17 |59% |
44
- |Emphasis and strong emphasis|62 of 128|48% |
45
- |Links |46 of 84 |55% |
46
- |Images |13 of 22 |59% |
47
- |Autolinks |14 of 19 |74% |
48
- |Hard line breaks |32 of 36 |89% |
49
- |Soft line breaks |1 of 2 |50% |
28
+ |Section |Count |Percent |
29
+ |:---------------------------------------|:---------:|-------:|
30
+ |Tabs | 7 of 11 | 64%|
31
+ |Thematic breaks | 18 of 19 | 95%|
32
+ |ATX headings | 14 of 18 | 78%|
33
+ |Setext headings | 21 of 26 | 81%|
34
+ |Indented code blocks | 11 of 12 | 92%|
35
+ |Fenced code blocks | 17 of 28 | 61%|
36
+ |HTML blocks | 12 of 43 | 28%|
37
+ |Link reference definitions | 21 of 23 | 91%|
38
+ |Paragraphs | 6 of 8 | 75%|
39
+ |Block quotes | 21 of 25 | 84%|
40
+ |List items | 32 of 48 | 67%|
41
+ |Lists | 10 of 24 | 42%|
42
+ |Backslash escapes | 4 of 13 | 31%|
43
+ |Entity and numeric character references | 8 of 12 | 67%|
44
+ |Code spans | 10 of 17 | 59%|
45
+ |Emphasis and strong emphasis | 71 of 128 | 55%|
46
+ |Links | 45 of 84 | 54%|
47
+ |Images | 13 of 22 | 59%|
48
+ |Autolinks | 14 of 19 | 74%|
49
+ |Raw HTML | 13 of 21 | 62%|
50
+ |Hard line breaks | 32 of 36 | 89%|
51
+ |Soft line breaks | 1 of 2 | 50%|
50
52
*/
51
53
52
54
describe ( 'CommonMark 0.28 Tabs' , function ( ) {
@@ -169,7 +171,7 @@ describe('CommonMark 0.28 HTML blocks', function() {
169
171
var section = 'HTML blocks' ;
170
172
171
173
// var shouldPassButFails = [];
172
- var shouldPassButFails = [ 132 , 126 , 147 , 121 , 124 , 120 , 153 , 133 , 119 , 127 , 117 , 118 , 141 , 116 , 158 , 122 , 123 , 128 , 143 , 130 , 136 , 137 , 140 , 125 , 134 , 131 , 144 , 145 , 146 , 148 , 139 , 149 , 129 , 156 , 135 , 138 , 142 , 150 , 151 , 152 , 154 , 155 , 157 ] ;
174
+ var shouldPassButFails = [ 132 , 126 , 147 , 124 , 120 , 153 , 133 , 119 , 127 , 118 , 141 , 116 , 158 , 123 , 143 , 130 , 137 , 140 , 125 , 134 , 131 , 144 , 145 , 148 , 139 , 149 , 129 , 156 , 135 , 138 , 155 ] ;
173
175
174
176
var willNotBeAttemptedByCoreTeam = [ ] ;
175
177
@@ -259,7 +261,7 @@ describe('CommonMark 0.28 Lists', function() {
259
261
var section = 'Lists' ;
260
262
261
263
// var shouldPassButFails = [];
262
- var shouldPassButFails = [ 282 , 270 , 280 , 278 , 271 , 272 , 273 , 275 , 274 , 264 , 277 , 265 , 276 , 279 , 267 , 269 ] ;
264
+ var shouldPassButFails = [ 282 , 270 , 280 , 278 , 273 , 275 , 274 , 264 , 277 , 265 , 276 , 279 , 267 , 269 ] ;
263
265
264
266
var willNotBeAttemptedByCoreTeam = [ ] ;
265
267
@@ -319,7 +321,7 @@ describe('CommonMark 0.28 Code spans', function() {
319
321
var section = 'Code spans' ;
320
322
321
323
// var shouldPassButFails = [];
322
- var shouldPassButFails = [ 330 , 316 , 325 , 327 , 328 , 320 , 323 , 322 ] ;
324
+ var shouldPassButFails = [ 330 , 316 , 327 , 328 , 320 , 323 , 322 ] ;
323
325
324
326
var willNotBeAttemptedByCoreTeam = [ ] ;
325
327
@@ -394,7 +396,7 @@ describe('CommonMark 0.28 Raw HTML', function() {
394
396
var section = 'Raw HTML' ;
395
397
396
398
// var shouldPassButFails = [];
397
- var shouldPassButFails = [ 584 , 585 , 586 , 587 , 588 , 590 , 594 , 595 , 596 , 597 , 598 , 599 , 600 , 601 , 602 , 603 , 604 ] ;
399
+ var shouldPassButFails = [ 590 , 595 , 597 , 598 , 599 , 600 , 601 , 604 ] ;
398
400
399
401
var willNotBeAttemptedByCoreTeam = [ ] ;
400
402
@@ -409,7 +411,7 @@ describe('CommonMark 0.28 Hard line breaks', function() {
409
411
var section = 'Hard line breaks' ;
410
412
411
413
// var shouldPassButFails = [];
412
- var shouldPassButFails = [ 611 , 606 , 609 , 613 , 614 , 615 ] ;
414
+ var shouldPassButFails = [ 611 , 606 , 609 , 613 ] ;
413
415
414
416
var willNotBeAttemptedByCoreTeam = [ ] ;
415
417
0 commit comments