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

Side by Side Diff: test/case_insensitive_map_test.dart

Issue 1320533002: Add a CaseInsensitiveMap class. (Closed) Base URL: git@github.com:dart-lang/http_parser@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « pubspec.yaml ('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
(Empty)
1 // Copyright (c) 2015, 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 import 'package:http_parser/http_parser.dart';
6 import 'package:test/test.dart';
7
8 void main() {
9 test("provides case-insensitive access to the map", () {
10 var map = new CaseInsensitiveMap();
11 map["fOo"] = "bAr";
12 expect(map, containsPair("FoO", "bAr"));
13
14 map["foo"] = "baz";
15 expect(map, containsPair("FOO", "baz"));
16 });
17
18 test("stores the original key cases", () {
19 var map = new CaseInsensitiveMap();
20 map["fOo"] = "bAr";
21 expect(map, equals({"fOo": "bAr"}));
22 });
23
24 test(".from() converts an existing map", () {
25 var map = new CaseInsensitiveMap.from({"fOo": "bAr"});
26 expect(map, containsPair("FoO", "bAr"));
27 expect(map, equals({"fOo": "bAr"}));
28 });
29 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698