Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
39f1f7c4
Commit
39f1f7c4
authored
Dec 19, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestOutMessageAppendString
parent
c1af0dbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
internal/buffer/out_message_test.go
internal/buffer/out_message_test.go
+27
-1
No files found.
internal/buffer/out_message_test.go
View file @
39f1f7c4
...
...
@@ -119,7 +119,33 @@ func TestOutMessageAppend(t *testing.T) {
}
func
TestOutMessageAppendString
(
t
*
testing
.
T
)
{
t
.
Fatal
(
"TODO"
)
var
om
OutMessage
om
.
Reset
()
// Append some payload.
const
wantPayload
=
"tacoburrito"
om
.
AppendString
(
wantPayload
[
:
4
])
om
.
AppendString
(
wantPayload
[
4
:
])
// The result should be a zeroed header followed by the desired payload.
const
wantLen
=
int
(
OutMessageInitialSize
)
+
len
(
wantPayload
)
if
got
,
want
:=
om
.
Len
(),
wantLen
;
got
!=
want
{
t
.
Errorf
(
"om.Len() = %d, want %d"
,
got
,
want
)
}
b
:=
om
.
Bytes
()
if
got
,
want
:=
len
(
b
),
wantLen
;
got
!=
want
{
t
.
Fatalf
(
"len(om.Bytes()) = %d, want %d"
,
got
,
want
)
}
want
:=
append
(
make
([]
byte
,
OutMessageInitialSize
),
wantPayload
...
)
if
!
bytes
.
Equal
(
b
,
want
)
{
t
.
Error
(
"messages differ"
)
}
}
func
TestOutMessageShrinkTo
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment