Skip to content

Commit 8cfcf43

Browse files
committed
Add more tests and prepare for a rewrite of the tests tomorrow
1 parent de687ea commit 8cfcf43

File tree

3 files changed

+197
-45
lines changed

3 files changed

+197
-45
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
fmt:
44
docker:
5-
- image: nhooyr/websocket-ci
5+
- image: nhooyr/websocket-ci@sha256:371ca985ce2548840aeb0f8434a551708cdfe0628be722c361958e65cdded945
66
steps:
77
- checkout
88
- restore_cache:
@@ -19,7 +19,7 @@ jobs:
1919

2020
lint:
2121
docker:
22-
- image: nhooyr/websocket-ci
22+
- image: nhooyr/websocket-ci@sha256:371ca985ce2548840aeb0f8434a551708cdfe0628be722c361958e65cdded945
2323
steps:
2424
- checkout
2525
- restore_cache:
@@ -36,7 +36,7 @@ jobs:
3636

3737
test:
3838
docker:
39-
- image: nhooyr/websocket-ci
39+
- image: nhooyr/websocket-ci@sha256:371ca985ce2548840aeb0f8434a551708cdfe0628be722c361958e65cdded945
4040
steps:
4141
- checkout
4242
- restore_cache:

export_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ import (
66

77
type Addr = websocketAddr
88

9-
type Header = header
10-
119
const OPClose = opClose
10+
const OPBinary = opBinary
1211
const OPPing = opPing
12+
const OPContinuation = opContinuation
1313

1414
func (c *Conn) WriteFrame(ctx context.Context, fin bool, opcode opcode, p []byte) (int, error) {
1515
return c.writeFrame(ctx, fin, opcode, p)
1616
}
1717

18+
func (c *Conn) WriteHalfFrame(ctx context.Context) (int, error) {
19+
return c.realWriteFrame(ctx, header{
20+
opcode: opBinary,
21+
payloadLength: 5,
22+
}, make([]byte, 10))
23+
}
24+
1825
func (c *Conn) Flush() error {
1926
return c.bw.Flush()
2027
}

0 commit comments

Comments
 (0)