Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/git2go/command_test.go')
-rw-r--r--internal/git2go/command_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/git2go/command_test.go b/internal/git2go/command_test.go
new file mode 100644
index 000000000..14f1c0a3a
--- /dev/null
+++ b/internal/git2go/command_test.go
@@ -0,0 +1,28 @@
+package git2go
+
+import (
+ "bytes"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestSerialization_SerializeTo(t *testing.T) {
+ type testStruct struct {
+ Contents string `json:"contents"`
+ }
+
+ var buf bytes.Buffer
+
+ input := testStruct{
+ Contents: "foobar",
+ }
+ err := serializeTo(&buf, &input)
+ require.NoError(t, err)
+ require.NotZero(t, buf.Len())
+
+ var output testStruct
+ err = deserialize(buf.String(), &output)
+ require.NoError(t, err)
+ require.Equal(t, input, output)
+}