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

Side by Side Diff: packages/collection/test/ignore_ascii_case_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 /// Tests case-ignoring compare and equality.
6
7 import "package:collection/collection.dart";
8 import "package:test/test.dart";
9
10 main() {
11 test("equality ignore ASCII case", () {
12 var strings = [
13 "0@`aopz[{",
14 "0@`aopz[{",
15 "0@`Aopz[{",
16 "0@`aOpz[{",
17 "0@`AOpz[{",
18 "0@`aoPz[{",
19 "0@`AoPz[{",
20 "0@`aOPz[{",
21 "0@`AOPz[{",
22 "0@`aopZ[{",
23 "0@`AopZ[{",
24 "0@`aOpZ[{",
25 "0@`AOpZ[{",
26 "0@`aoPZ[{",
27 "0@`AoPZ[{",
28 "0@`aOPZ[{",
29 "0@`AOPZ[{",
30 ];
31
32 for (var s1 in strings) {
33 for (var s2 in strings) {
34 var reason = "$s1 =?= $s2";
35 expect(equalsIgnoreAsciiCase(s1, s2), true, reason: reason);
36 expect(hashIgnoreAsciiCase(s1), hashIgnoreAsciiCase(s2),
37 reason: reason);
38 }
39 }
40
41 var upperCaseLetters = "@`abcdefghijklmnopqrstuvwxyz[{åÅ";
42 var lowerCaseLetters = "@`ABCDEFGHIJKLMNOPQRSTUVWXYZ[{åÅ";
43 expect(equalsIgnoreAsciiCase(upperCaseLetters, lowerCaseLetters), true);
44
45 testChars(char1, char2, areEqual) {
46 expect(equalsIgnoreAsciiCase(char1, char2), areEqual,
47 reason: "$char1 ${areEqual ? "=" : "!"}= $char2");
48 }
49
50 for (int i = 0; i < upperCaseLetters.length; i++) {
51 for (int j = 0; i < upperCaseLetters.length; i++) {
52 testChars(upperCaseLetters[i], upperCaseLetters[j], i == j);
53 testChars(lowerCaseLetters[i], upperCaseLetters[j], i == j);
54 testChars(upperCaseLetters[i], lowerCaseLetters[j], i == j);
55 testChars(lowerCaseLetters[i], lowerCaseLetters[j], i == j);
56 }
57 }
58 });
59 }
OLDNEW
« no previous file with comments | « packages/collection/test/functions_test.dart ('k') | packages/collection/test/iterable_zip_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698