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

Unified Diff: test/response_test.dart

Issue 1327453002: Share a body across all versions of a message. (Closed) Base URL: git@github.com:dart-lang/shelf@master
Patch Set: Code review changes Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/request_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/response_test.dart
diff --git a/test/response_test.dart b/test/response_test.dart
index 8b829bbb189a958222690ad681a6a91d7d0008ac..57c5c1c4d660893126ebf013e1b43332a4c6cba7 100644
--- a/test/response_test.dart
+++ b/test/response_test.dart
@@ -112,5 +112,32 @@ void main() {
..close();
});
});
+
+
+ test("allows the original response to be read", () {
+ var response = new Response.ok(null);
+ var changed = response.change();
+
+ expect(response.read().toList(), completion(isEmpty));
+ expect(changed.read, throwsStateError);
+ });
+
+ test("allows the changed response to be read", () {
+ var response = new Response.ok(null);
+ var changed = response.change();
+
+ expect(changed.read().toList(), completion(isEmpty));
+ expect(response.read, throwsStateError);
+ });
+
+ test("allows another changed response to be read", () {
+ var response = new Response.ok(null);
+ var changed1 = response.change();
+ var changed2 = response.change();
+
+ expect(changed2.read().toList(), completion(isEmpty));
+ expect(changed1.read, throwsStateError);
+ expect(response.read, throwsStateError);
+ });
});
}
« no previous file with comments | « test/request_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698