From 4c10bea8948109de01c2546f29595183df2e955a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisendo=CC=88rfer?= Date: Wed, 8 May 2013 16:02:33 +0200 Subject: [PATCH] Test overlapping resume --- src/http/handler_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/http/handler_test.go b/src/http/handler_test.go index 305ce31..57d5791 100644 --- a/src/http/handler_test.go +++ b/src/http/handler_test.go @@ -200,6 +200,30 @@ var Protocol_Core_Tests = []struct { }, }, }, + { + Description: "Overlapping Resume", + FinalLength: 11, + ExpectFileContent: "hello world", + Requests: []TestRequest{ + { + Method: "PATCH", + Headers: map[string]string{"Offset": "0"}, + Body: "hello wo", + ExpectStatusCode: http.StatusOK, + }, + { + Method: "HEAD", + ExpectStatusCode: http.StatusOK, + ExpectHeaders: map[string]string{"Offset": "8"}, + }, + { + Method: "PATCH", + Headers: map[string]string{"Offset": "5"}, + Body: " world", + ExpectStatusCode: http.StatusOK, + }, + }, + }, { Description: "Offset exceeded", FinalLength: 5,