From 23bc5f4fb7542e64c94eaa7fe2c7a6aa55010898 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 09:40:39 -0600 Subject: move common types to an internal package This helps avoid import cycles. --- gemini/response_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'gemini/response_test.go') diff --git a/gemini/response_test.go b/gemini/response_test.go index 00166dd..784e00a 100644 --- a/gemini/response_test.go +++ b/gemini/response_test.go @@ -6,15 +6,15 @@ import ( "io" "testing" - sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/internal/types" "tildegit.org/tjp/sliderule/gemini" ) func TestBuildResponses(t *testing.T) { table := []struct { name string - response *sr.Response - status sr.Status + response *types.Response + status types.Status meta string body string }{ @@ -154,7 +154,7 @@ func TestBuildResponses(t *testing.T) { func TestParseResponses(t *testing.T) { table := []struct { input string - status sr.Status + status types.Status meta string body string err error @@ -233,7 +233,7 @@ func TestParseResponses(t *testing.T) { func TestResponseClose(t *testing.T) { body := &rdCloser{Buffer: bytes.NewBufferString("the body here")} - resp := &sr.Response{ + resp := &types.Response{ Status: gemini.StatusSuccess, Meta: "text/gemini", Body: body, @@ -247,7 +247,7 @@ func TestResponseClose(t *testing.T) { t.Error("response body was not closed by response.Close()") } - resp = &sr.Response{ + resp = &types.Response{ Status: gemini.StatusInput, Meta: "give me more", } @@ -270,8 +270,8 @@ func (rc *rdCloser) Close() error { func TestResponseWriteTo(t *testing.T) { // invariant under test: WriteTo() sends the same bytes as Read() - clone := func(resp *sr.Response) *sr.Response { - other := &sr.Response{ + clone := func(resp *types.Response) *types.Response { + other := &types.Response{ Status: resp.Status, Meta: resp.Meta, } @@ -297,7 +297,7 @@ func TestResponseWriteTo(t *testing.T) { table := []struct { name string - response *sr.Response + response *types.Response }{ { name: "simple success", -- cgit v1.2.3