From 8ec11c0b536a7de52bcf2ed661b651758156e007 Mon Sep 17 00:00:00 2001 From: Lucas Clemente Date: Thu, 3 Aug 2017 18:46:34 +0200 Subject: [PATCH] Move testdata/ to internal/ --- benchmark/benchmark_test.go | 2 +- crypto/cert_chain_test.go | 2 +- crypto/cert_manager_test.go | 2 +- crypto/server_proof_test.go | 4 ++-- h2quic/server_test.go | 2 +- integrationtests/handshake/rtt.go | 2 +- integrationtests/integrationtests_suite_test.go | 2 +- {testdata => internal/testdata}/cert.go | 2 +- session_test.go | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) rename {testdata => internal/testdata}/cert.go (92%) diff --git a/benchmark/benchmark_test.go b/benchmark/benchmark_test.go index d7a24d213..9d0f4b4e3 100644 --- a/benchmark/benchmark_test.go +++ b/benchmark/benchmark_test.go @@ -10,7 +10,7 @@ import ( quic "github.com/lucas-clemente/quic-go" "github.com/lucas-clemente/quic-go/protocol" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) diff --git a/crypto/cert_chain_test.go b/crypto/cert_chain_test.go index a4ee57a3e..fd60a46a2 100644 --- a/crypto/cert_chain_test.go +++ b/crypto/cert_chain_test.go @@ -7,7 +7,7 @@ import ( "crypto/tls" "reflect" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/crypto/cert_manager_test.go b/crypto/cert_manager_test.go index 8bad8f951..3b7e491c4 100644 --- a/crypto/cert_manager_test.go +++ b/crypto/cert_manager_test.go @@ -12,7 +12,7 @@ import ( "time" "github.com/lucas-clemente/quic-go/qerr" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/crypto/server_proof_test.go b/crypto/server_proof_test.go index ed96a6bfe..aecd63e3e 100644 --- a/crypto/server_proof_test.go +++ b/crypto/server_proof_test.go @@ -11,14 +11,14 @@ import ( "encoding/asn1" "math/big" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Proof", func() { - It("gives valid signatures with the key in testdata", func() { + It("gives valid signatures with the key in internal/testdata", func() { key := &testdata.GetTLSConfig().Certificates[0] signature, err := signServerProof(key, []byte{'C', 'H', 'L', 'O'}, []byte{'S', 'C', 'F', 'G'}) Expect(err).ToNot(HaveOccurred()) diff --git a/h2quic/server_test.go b/h2quic/server_test.go index 89edd6411..636a3bcfa 100644 --- a/h2quic/server_test.go +++ b/h2quic/server_test.go @@ -20,7 +20,7 @@ import ( quic "github.com/lucas-clemente/quic-go" "github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/qerr" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/integrationtests/handshake/rtt.go b/integrationtests/handshake/rtt.go index d998caf5a..158c84910 100644 --- a/integrationtests/handshake/rtt.go +++ b/integrationtests/handshake/rtt.go @@ -12,7 +12,7 @@ import ( "github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/qerr" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) diff --git a/integrationtests/integrationtests_suite_test.go b/integrationtests/integrationtests_suite_test.go index 726b5c7bc..e036cc3e0 100644 --- a/integrationtests/integrationtests_suite_test.go +++ b/integrationtests/integrationtests_suite_test.go @@ -19,7 +19,7 @@ import ( "github.com/lucas-clemente/quic-go/h2quic" "github.com/lucas-clemente/quic-go/internal/utils" - "github.com/lucas-clemente/quic-go/testdata" + "github.com/lucas-clemente/quic-go/internal/testdata" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/testdata/cert.go b/internal/testdata/cert.go similarity index 92% rename from testdata/cert.go rename to internal/testdata/cert.go index fcc85df88..6acfbb5a3 100644 --- a/testdata/cert.go +++ b/internal/testdata/cert.go @@ -14,7 +14,7 @@ func init() { panic("Failed to get current frame") } - certPath = path.Join(path.Dir(path.Dir(filename)), "example") + certPath = path.Join(path.Dir(path.Dir(path.Dir(filename))), "example") } // GetCertificatePaths returns the paths to 'fullchain.pem' and 'privkey.pem' for the diff --git a/session_test.go b/session_test.go index edde1aec5..a6644c1ff 100644 --- a/session_test.go +++ b/session_test.go @@ -20,9 +20,9 @@ import ( "github.com/lucas-clemente/quic-go/handshake" "github.com/lucas-clemente/quic-go/internal/mocks" "github.com/lucas-clemente/quic-go/internal/mocks/mocks_fc" + "github.com/lucas-clemente/quic-go/internal/testdata" "github.com/lucas-clemente/quic-go/protocol" "github.com/lucas-clemente/quic-go/qerr" - "github.com/lucas-clemente/quic-go/testdata" ) type mockConnection struct {