Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(676)

Unified Diff: src/pkg/crypto/tls/record_read_test.go

Issue 180047: code review 180047: 1) Change default gofmt default settings for (Closed)
Patch Set: code review 180047: 1) Change default gofmt default settings for Created 15 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/crypto/tls/record_read.go ('k') | src/pkg/crypto/tls/record_write.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/crypto/tls/record_read_test.go
===================================================================
--- a/src/pkg/crypto/tls/record_read_test.go
+++ b/src/pkg/crypto/tls/record_read_test.go
@@ -5,9 +5,9 @@
package tls
import (
- "bytes";
- "testing";
- "testing/iotest";
+ "bytes"
+ "testing"
+ "testing/iotest"
)
func matchRecord(r1, r2 *record) bool {
@@ -20,12 +20,12 @@
return r1.contentType == r2.contentType &&
r1.major == r2.major &&
r1.minor == r2.minor &&
- bytes.Compare(r1.payload, r2.payload) == 0;
+ bytes.Compare(r1.payload, r2.payload) == 0
}
type recordReaderTest struct {
- in []byte;
- out []*record;
+ in []byte
+ out []*record
}
var recordReaderTests = []recordReaderTest{
@@ -42,31 +42,31 @@
func TestRecordReader(t *testing.T) {
for i, test := range recordReaderTests {
- buf := bytes.NewBuffer(test.in);
- c := make(chan *record);
- go recordReader(c, buf);
- matchRecordReaderOutput(t, i, test, c);
+ buf := bytes.NewBuffer(test.in)
+ c := make(chan *record)
+ go recordReader(c, buf)
+ matchRecordReaderOutput(t, i, test, c)
- buf = bytes.NewBuffer(test.in);
- buf2 := iotest.OneByteReader(buf);
- c = make(chan *record);
- go recordReader(c, buf2);
- matchRecordReaderOutput(t, i*2, test, c);
+ buf = bytes.NewBuffer(test.in)
+ buf2 := iotest.OneByteReader(buf)
+ c = make(chan *record)
+ go recordReader(c, buf2)
+ matchRecordReaderOutput(t, i*2, test, c)
}
}
func matchRecordReaderOutput(t *testing.T, i int, test recordReaderTest, c <-chan *record) {
for j, r1 := range test.out {
- r2 := <-c;
+ r2 := <-c
if r2 == nil {
- t.Errorf("#%d truncated after %d values", i, j);
- break;
+ t.Errorf("#%d truncated after %d values", i, j)
+ break
}
if !matchRecord(r1, r2) {
t.Errorf("#%d (%d) got:%#v want:%#v", i, j, r2, r1)
}
}
- <-c;
+ <-c
if !closed(c) {
t.Errorf("#%d: channel didn't close", i)
}
« no previous file with comments | « src/pkg/crypto/tls/record_read.go ('k') | src/pkg/crypto/tls/record_write.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b