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

Unified Diff: test/media_type_test.dart

Issue 1419493002: Make MediaType case-insensitive, following the spec. (Closed) Base URL: git@github.com:dart-lang/http_parser@master
Patch Set: Add tests Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/media_type_test.dart
diff --git a/test/media_type_test.dart b/test/media_type_test.dart
index 0a9f904004243e83e3463be232b710c1475c9294..98f482becd59b8bccb947edf14fb943ba1e97cf6 100644
--- a/test/media_type_test.dart
+++ b/test/media_type_test.dart
@@ -70,6 +70,23 @@ void main() {
expect(
type.parameters, equals({"foo": "bar space", "baz": "bang\\escape"}));
});
+
+ test("lower-cases type and subtype", () {
+ var type = new MediaType.parse('TeXt/pLaIn');
+ expect(type.type, equals("text"));
+ expect(type.subtype, equals("plain"));
+ expect(type.mimeType, equals("text/plain"));
+ });
+
+ test("records parameters as case-insensitive", () {
+ var type = new MediaType.parse('test/plain;FoO=bar;bAz=bang');
+ expect(type.parameters, equals({
+ "FoO": "bar",
+ "bAz": "bang"
+ }));
+ expect(type.parameters, containsPair("foo", "bar"));
+ expect(type.parameters, containsPair("baz", "bang"));
+ });
});
group("change", () {
« 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