multiplexer_test.go 666 B

1234567891011121314151617181920212223
  1. package quic
  2. import (
  3. . "github.com/onsi/ginkgo"
  4. . "github.com/onsi/gomega"
  5. )
  6. var _ = Describe("Client Multiplexer", func() {
  7. It("adds a new packet conn ", func() {
  8. conn := newMockPacketConn()
  9. _, err := getMultiplexer().AddConn(conn, 8)
  10. Expect(err).ToNot(HaveOccurred())
  11. })
  12. It("errors when adding an existing conn with a different connection ID length", func() {
  13. conn := newMockPacketConn()
  14. _, err := getMultiplexer().AddConn(conn, 5)
  15. Expect(err).ToNot(HaveOccurred())
  16. _, err = getMultiplexer().AddConn(conn, 6)
  17. Expect(err).To(MatchError("cannot use 6 byte connection IDs on a connection that is already using 5 byte connction IDs"))
  18. })
  19. })