OLD | NEW |
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 library bidi_format_test; | 5 library bidi_format_test; |
6 | 6 |
7 import 'package:intl/intl.dart'; | 7 import 'package:intl/intl.dart'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:test/test.dart'; |
9 | 9 |
10 /** | 10 /// Tests the bidirectional text formatting library. |
11 * Tests the bidirectional text formatting library. | |
12 */ | |
13 main() { | 11 main() { |
14 var LTR = TextDirection.LTR; | 12 var LTR = TextDirection.LTR; |
15 var RTL = TextDirection.RTL; | 13 var RTL = TextDirection.RTL; |
16 var LRM = Bidi.LRM; | 14 var LRM = Bidi.LRM; |
17 var RLM = Bidi.RLM; | 15 var RLM = Bidi.RLM; |
18 var RLE = Bidi.RLE; | 16 var RLE = Bidi.RLE; |
19 var PDF = Bidi.PDF; | 17 var PDF = Bidi.PDF; |
20 var LRE = Bidi.LRE; | 18 var LRE = Bidi.LRE; |
21 var UNKNOWN = TextDirection.UNKNOWN; | 19 var UNKNOWN = TextDirection.UNKNOWN; |
22 var he = '\u05e0\u05e1'; | 20 var he = '\u05e0\u05e1'; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 expect(rtlFmt.wrapWithUnicode(he, direction: TextDirection.LTR), | 216 expect(rtlFmt.wrapWithUnicode(he, direction: TextDirection.LTR), |
219 equals('$LRE$he$PDF$RLM')); | 217 equals('$LRE$he$PDF$RLM')); |
220 // Test supposed overall dir (LTR) doesn't match context dir (unknown). | 218 // Test supposed overall dir (LTR) doesn't match context dir (unknown). |
221 expect(unkFmt.wrapWithUnicode(he, direction: TextDirection.LTR), | 219 expect(unkFmt.wrapWithUnicode(he, direction: TextDirection.LTR), |
222 equals('$LRE$he$PDF')); | 220 equals('$LRE$he$PDF')); |
223 // Test supposed overall dir (neutral) doesn't match context dir (LTR). | 221 // Test supposed overall dir (neutral) doesn't match context dir (LTR). |
224 expect(ltrFmt.wrapWithUnicode(he, direction: TextDirection.UNKNOWN), | 222 expect(ltrFmt.wrapWithUnicode(he, direction: TextDirection.UNKNOWN), |
225 equals('$he$LRM')); | 223 equals('$he$LRM')); |
226 }); | 224 }); |
227 } | 225 } |
OLD | NEW |