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

Unified Diff: test/request_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 | « pubspec.yaml ('k') | test/response_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/request_test.dart
diff --git a/test/request_test.dart b/test/request_test.dart
index b02de541f903d195d2a31a65f7882f6ed9a74714..d7d20311911ddac05075ad2592946b431dea9833 100644
--- a/test/request_test.dart
+++ b/test/request_test.dart
@@ -278,5 +278,31 @@ void main() {
expect(() => request.change(path: 'di'), throwsArgumentError);
});
});
+
+ test("allows the original request to be read", () {
+ var request = _request();
+ var changed = request.change();
+
+ expect(request.read().toList(), completion(isEmpty));
+ expect(changed.read, throwsStateError);
+ });
+
+ test("allows the changed request to be read", () {
+ var request = _request();
+ var changed = request.change();
+
+ expect(changed.read().toList(), completion(isEmpty));
+ expect(request.read, throwsStateError);
+ });
+
+ test("allows another changed request to be read", () {
+ var request = _request();
+ var changed1 = request.change();
+ var changed2 = request.change();
+
+ expect(changed2.read().toList(), completion(isEmpty));
+ expect(changed1.read, throwsStateError);
+ expect(request.read, throwsStateError);
+ });
});
}
« no previous file with comments | « pubspec.yaml ('k') | test/response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698