Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"compress/gzip"
"crypto/rand"
"encoding/gob"
"encoding/json"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestTruncated(t *testing.T) {

// TestGolden tests against known test vectors.
func TestGolden(t *testing.T) {
f, err := os.Open(filepath.Join("testdata", "golden.gob.gz"))
f, err := os.Open(filepath.Join("testdata", "golden.json.gz"))
if err != nil {
t.Fatal(err)
}
Expand All @@ -270,7 +270,7 @@ func TestGolden(t *testing.T) {
}
t.Cleanup(func() { gzr.Close() })

dec := gob.NewDecoder(gzr)
dec := json.NewDecoder(gzr)
for i := 0; ; i++ {
var v golden.Vector
err := dec.Decode(&v)
Expand Down
8 changes: 4 additions & 4 deletions testdata/gen.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// +build ignore
//go:build ignore

package main

import (
"archive/zip"
"compress/gzip"
"crypto/rand"
"encoding/gob"
"encoding/json"
"io"
"os"

Expand Down Expand Up @@ -36,7 +36,7 @@ func main1() error {
return err
}

out, err := os.Create("golden.gob.gz")
out, err := os.Create("golden.json.gz")
if err != nil {
return err
}
Expand All @@ -48,7 +48,7 @@ func main1() error {
}
defer gzw.Close()

enc := gob.NewEncoder(gzw)
enc := json.NewEncoder(gzw)

for _, f := range r.File {
seed := make([]byte, 32)
Expand Down
Binary file removed testdata/golden.gob.gz
Binary file not shown.
Binary file added testdata/golden.json.gz
Binary file not shown.