OLD | NEW |
(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 } |
OLD | NEW |