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

Side by Side Diff: third_party/pkg/markdown/test/markdown_test.dart

Issue 18497012: Add markdown to third_party/pkg (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months 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
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 markdownTests; 6 library markdownTests;
7 7
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 // TODO(rnystrom): Use "package:" URL (#4968). 10 // TODO(rnystrom): Use "package:" URL (#4968).
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 <pre><code>three</code></pre> 417 <pre><code>three</code></pre>
418 '''); 418 ''');
419 419
420 validate('escape HTML characters', ''' 420 validate('escape HTML characters', '''
421 <&> 421 <&>
422 ''', ''' 422 ''', '''
423 <pre><code>&lt;&amp;&gt;</code></pre> 423 <pre><code>&lt;&amp;&gt;</code></pre>
424 '''); 424 ''');
425 }); 425 });
426 426
427 group('Fenced code blocks', () {
428 validate('without an optional language identifier', '''
429 ```
430 code
431 ```
432 ''', '''
433 <pre><code>code
434 </code></pre>
435 ''');
436
437 validate('with an optional language identifier', '''
438 ```dart
439 code
440 ```
441 ''', '''
442 <pre><code>code
443 </code></pre>
444 ''');
445
446 validate('escape HTML characters', '''
447 ```
448 <&>
449 ```
450 ''', '''
451 <pre><code>&lt;&amp;&gt;
452 </code></pre>
453 ''');
454 });
455
427 group('Horizontal rules', () { 456 group('Horizontal rules', () {
428 validate('from dashes', ''' 457 validate('from dashes', '''
429 --- 458 ---
430 ''', ''' 459 ''', '''
431 <hr /> 460 <hr />
432 '''); 461 ''');
433 462
434 validate('from asterisks', ''' 463 validate('from asterisks', '''
435 *** 464 ***
436 ''', ''' 465 ''', '''
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 932
904 // If one string runs out of non-ignored strings, the other must too. 933 // If one string runs out of non-ignored strings, the other must too.
905 if (i == a.length) return j == b.length; 934 if (i == a.length) return j == b.length;
906 if (j == b.length) return i == a.length; 935 if (j == b.length) return i == a.length;
907 936
908 if (a[i] != b[j]) return false; 937 if (a[i] != b[j]) return false;
909 i++; 938 i++;
910 j++; 939 j++;
911 } 940 }
912 } 941 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698