summaryrefslogtreecommitdiff
path: root/gemini/response_test.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-08-12 09:40:39 -0600
committertjpcc <tjp@ctrl-c.club>2023-08-12 09:40:39 -0600
commit23bc5f4fb7542e64c94eaa7fe2c7a6aa55010898 (patch)
treeec8113d3aa2379e3ca9cb3c6e13a5531895ea8c0 /gemini/response_test.go
parent57a31a9b2cd549174d839b9b91b47db337f174cc (diff)
move common types to an internal package
This helps avoid import cycles.
Diffstat (limited to 'gemini/response_test.go')
-rw-r--r--gemini/response_test.go18
1 files changed, 9 insertions, 9 deletions
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",