Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e72a782b
Commit
e72a782b
authored
Feb 17, 2014
by
Joey Zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding compact decode tests
parent
e5b97fe0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
encoding_test.go
ethutil/encoding_test.go
+30
-0
No files found.
ethutil/encoding_test.go
View file @
e72a782b
...
...
@@ -35,3 +35,33 @@ func TestCompactHexDecode(t *testing.T) {
t
.
Error
(
"Error compact hex decode. Expected"
,
exp
,
"got"
,
res
)
}
}
func
TestCompactDecode
(
t
*
testing
.
T
)
{
exp
:=
[]
int
{
1
,
2
,
3
,
4
,
5
}
res
:=
CompactDecode
(
"
\x11\x23\x45
"
)
if
!
CompareIntSlice
(
res
,
exp
)
{
t
.
Error
(
"odd compact decode. Expected"
,
exp
,
"got"
,
res
)
}
exp
=
[]
int
{
0
,
1
,
2
,
3
,
4
,
5
}
res
=
CompactDecode
(
"
\x00\x01\x23\x45
"
)
if
!
CompareIntSlice
(
res
,
exp
)
{
t
.
Error
(
"even compact decode. Expected"
,
exp
,
"got"
,
res
)
}
exp
=
[]
int
{
0
,
15
,
1
,
12
,
11
,
8
/*term*/
,
16
}
res
=
CompactDecode
(
"
\x20\x0f\x1c\xb8
"
)
if
!
CompareIntSlice
(
res
,
exp
)
{
t
.
Error
(
"even terminated compact decode. Expected"
,
exp
,
"got"
,
res
)
}
exp
=
[]
int
{
15
,
1
,
12
,
11
,
8
/*term*/
,
16
}
res
=
CompactDecode
(
"
\x3f\x1c\xb8
"
)
if
!
CompareIntSlice
(
res
,
exp
)
{
t
.
Error
(
"even terminated compact decode. Expected"
,
exp
,
"got"
,
res
)
}
}
\ No newline at end of file
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