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

Side by Side Diff: pkg/intl/test/bidi_format_test.dart

Issue 11032035: Move Bidi functions into methods to make the docs look better (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « pkg/intl/lib/src/intl_helpers.dart ('k') | pkg/intl/test/bidi_utils_test.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 5
6 #library('bidi_format_test'); 6 #library('bidi_format_test');
7 7
8 #import('../lib/intl.dart'); 8 #import('../lib/intl.dart');
9 #import('../../../pkg/unittest/unittest.dart'); 9 #import('../../../pkg/unittest/unittest.dart');
10 10
11 /** 11 /**
12 * Tests the bidirectional text formatting library. 12 * Tests the bidirectional text formatting library.
13 */ 13 */
14 main() { 14 main() {
15 var LTR = TextDirection.LTR; 15 var LTR = TextDirection.LTR;
16 var RTL = TextDirection.RTL; 16 var RTL = TextDirection.RTL;
17 var LRM = Bidi.LRM;
18 var RLM = Bidi.RLM;
19 var RLE = Bidi.RLE;
20 var PDF = Bidi.PDF;
21 var LRE = Bidi.LRE;
17 var UNKNOWN = TextDirection.UNKNOWN; 22 var UNKNOWN = TextDirection.UNKNOWN;
18 var he = '\u05e0\u05e1'; 23 var he = '\u05e0\u05e1';
19 var en = 'abba'; 24 var en = 'abba';
20 var html = '<'; 25 var html = '<';
21 var longEn = 'abba sabba gabba '; 26 var longEn = 'abba sabba gabba ';
22 var longHe = '\u05e0 \u05e1 \u05e0 '; 27 var longHe = '\u05e0 \u05e1 \u05e0 ';
23 var ltrFmt = new BidiFormatter.LTR(); // LTR context 28 var ltrFmt = new BidiFormatter.LTR(); // LTR context
24 var rtlFmt = new BidiFormatter.RTL(); // RTL context 29 var rtlFmt = new BidiFormatter.RTL(); // RTL context
25 var unkFmt = new BidiFormatter.UNKNOWN(); // unknown context 30 var unkFmt = new BidiFormatter.UNKNOWN(); // unknown context
26 31
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 expect(rtlFmt.wrapWithUnicode(he, direction : TextDirection.LTR), 207 expect(rtlFmt.wrapWithUnicode(he, direction : TextDirection.LTR),
203 equals('$LRE$he$PDF$RLM')); 208 equals('$LRE$he$PDF$RLM'));
204 // Test supposed overall dir (LTR) doesn't match context dir (unknown). 209 // Test supposed overall dir (LTR) doesn't match context dir (unknown).
205 expect(unkFmt.wrapWithUnicode(he, direction : TextDirection.LTR), 210 expect(unkFmt.wrapWithUnicode(he, direction : TextDirection.LTR),
206 equals('$LRE$he$PDF')); 211 equals('$LRE$he$PDF'));
207 // Test supposed overall dir (neutral) doesn't match context dir (LTR). 212 // Test supposed overall dir (neutral) doesn't match context dir (LTR).
208 expect(ltrFmt.wrapWithUnicode(he, direction : TextDirection.UNKNOWN), 213 expect(ltrFmt.wrapWithUnicode(he, direction : TextDirection.UNKNOWN),
209 equals('$he$LRM')); 214 equals('$he$LRM'));
210 }); 215 });
211 } 216 }
OLDNEW
« no previous file with comments | « pkg/intl/lib/src/intl_helpers.dart ('k') | pkg/intl/test/bidi_utils_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698