Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: utils/markdown/test/markdown_tests.dart

Issue 8725007: Lots of stuff hooking up markdown to dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to awesome reviews. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/markdown/markdown.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Unit tests for markdown. 5 /// Unit tests for markdown.
6 #library('markdown_tests'); 6 #library('markdown_tests');
7 7
8 #import('../lib.dart'); 8 #import('../lib.dart');
9 9
10 // TODO(rnystrom): Better path to unittest. 10 // TODO(rnystrom): Better path to unittest.
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 ''', ''' 596 ''', '''
597 <p>before <code>can `contain` backticks</code> after</p> 597 <p>before <code>can `contain` backticks</code> after</p>
598 '''); 598 ''');
599 599
600 validate('double backticks with spaces', ''' 600 validate('double backticks with spaces', '''
601 before `` `tick` `` after 601 before `` `tick` `` after
602 ''', ''' 602 ''', '''
603 <p>before <code>`tick`</code> after</p> 603 <p>before <code>`tick`</code> after</p>
604 '''); 604 ''');
605 605
606 validate('multiline double backticks with spaces', '''
607 before ``in `tick`
608 another`` after
609 ''', '''
610 <p>before <code>in `tick`
611 another</code> after</p>
612 ''');
613
606 validate('ignore markup inside code', ''' 614 validate('ignore markup inside code', '''
607 before `*b* _c_` after 615 before `*b* _c_` after
608 ''', ''' 616 ''', '''
609 <p>before <code>*b* _c_</code> after</p> 617 <p>before <code>*b* _c_</code> after</p>
610 '''); 618 ''');
611 619
612 validate('escape HTML characters', ''' 620 validate('escape HTML characters', '''
613 `<&>` 621 `<&>`
614 ''', ''' 622 ''', '''
615 <p><code>&lt;&amp;&gt;</code></p> 623 <p><code>&lt;&amp;&gt;</code></p>
616 '''); 624 ''');
625
626 validate('escape HTML tags', '''
627 '*' `<em>`
628 ''', '''
629 <p>'*' <code>&lt;em&gt;</code></p>
630 ''');
617 }); 631 });
618 632
619 group('HTML encoding', () { 633 group('HTML encoding', () {
620 validate('less than and ampersand are escaped', ''' 634 validate('less than and ampersand are escaped', '''
621 < & 635 < &
622 ''', ''' 636 ''', '''
623 <p>&lt; &amp;</p> 637 <p>&lt; &amp;</p>
624 '''); 638 ''');
625 validate('greater than is not escaped', ''' 639 validate('greater than is not escaped', '''
626 not you > 640 not you >
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 ''', ''' 695 ''', '''
682 <p>[not] [known]</p> 696 <p>[not] [known]</p>
683 '''); 697 ''');
684 validate('can style link contents', ''' 698 validate('can style link contents', '''
685 links [*are*] [a] awesome 699 links [*are*] [a] awesome
686 700
687 [a]: http://foo.com 701 [a]: http://foo.com
688 ''', ''' 702 ''', '''
689 <p>links <a href="http://foo.com"><em>are</em></a> awesome</p> 703 <p>links <a href="http://foo.com"><em>are</em></a> awesome</p>
690 '''); 704 ''');
705 validate('inline styles after a bad link are processed', '''
706 [bad] `code`
707 ''', '''
708 <p>[bad] <code>code</code></p>
709 ''');
691 }); 710 });
692 711
693 group('Inline links', () { 712 group('Inline links', () {
694 validate('double quotes for title', ''' 713 validate('double quotes for title', '''
695 links [are](http://foo.com "woo") awesome 714 links [are](http://foo.com "woo") awesome
696 ''', ''' 715 ''', '''
697 <p>links <a href="http://foo.com" title="woo">are</a> awesome</p> 716 <p>links <a href="http://foo.com" title="woo">are</a> awesome</p>
698 '''); 717 ''');
699 validate('no title', ''' 718 validate('no title', '''
700 links [are] (http://foo.com) awesome 719 links [are] (http://foo.com) awesome
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 797
779 // If one string runs out of non-ignored strings, the other must too. 798 // If one string runs out of non-ignored strings, the other must too.
780 if (i == a.length) return j == b.length; 799 if (i == a.length) return j == b.length;
781 if (j == b.length) return i == a.length; 800 if (j == b.length) return i == a.length;
782 801
783 if (a[i] != b[j]) return false; 802 if (a[i] != b[j]) return false;
784 i++; 803 i++;
785 j++; 804 j++;
786 } 805 }
787 } 806 }
OLDNEW
« no previous file with comments | « utils/markdown/markdown.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698