Skip to content

Commit

Permalink
Merge pull request #105 from libp2p/bye-ginkgo
Browse files Browse the repository at this point in the history
migrate to standard Go tests, stop using Ginkgo
  • Loading branch information
marten-seemann authored Jan 4, 2022
2 parents 433e650 + 5ffe478 commit b4e9948
Show file tree
Hide file tree
Showing 3 changed files with 439 additions and 447 deletions.
25 changes: 12 additions & 13 deletions p2p/security/tls/extension_test.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package libp2ptls

import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"

"github.com/stretchr/testify/require"
)

var _ = Describe("Extensions", func() {
It("generates a prefixed extension ID", func() {
Expect(getPrefixedExtensionID([]int{13, 37})).To(Equal([]int{1, 3, 6, 1, 4, 1, 53594, 13, 37}))
})
func TestExtensionGenerating(t *testing.T) {
require.Equal(t, getPrefixedExtensionID([]int{13, 37}), []int{1, 3, 6, 1, 4, 1, 53594, 13, 37})
}

It("compares extension IDs", func() {
Expect(extensionIDEqual([]int{1, 2, 3, 4}, []int{1, 2, 3, 4})).To(BeTrue())
Expect(extensionIDEqual([]int{1, 2, 3, 4}, []int{1, 2, 3})).To(BeFalse())
Expect(extensionIDEqual([]int{1, 2, 3}, []int{1, 2, 3, 4})).To(BeFalse())
Expect(extensionIDEqual([]int{1, 2, 3, 4}, []int{4, 3, 2, 1})).To(BeFalse())
})
})
func TestExtensionComparison(t *testing.T) {
require.True(t, extensionIDEqual([]int{1, 2, 3, 4}, []int{1, 2, 3, 4}))
require.False(t, extensionIDEqual([]int{1, 2, 3, 4}, []int{1, 2, 3}))
require.False(t, extensionIDEqual([]int{1, 2, 3}, []int{1, 2, 3, 4}))
require.False(t, extensionIDEqual([]int{1, 2, 3, 4}, []int{4, 3, 2, 1}))
}
18 changes: 0 additions & 18 deletions p2p/security/tls/libp2p_tls_suite_test.go

This file was deleted.

Loading

0 comments on commit b4e9948

Please sign in to comment.