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
c2070f8d
Unverified
Commit
c2070f8d
authored
Jun 29, 2022
by
Seungbae.yu
Committed by
GitHub
Jun 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: increase StorageSize test coverage (#25188)
parent
3e693e1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
size_test.go
common/size_test.go
+21
-0
No files found.
common/size_test.go
View file @
c2070f8d
...
...
@@ -25,6 +25,8 @@ func TestStorageSizeString(t *testing.T) {
size
StorageSize
str
string
}{
{
2839274474874
,
"2.58 TiB"
},
{
2458492810
,
"2.29 GiB"
},
{
2381273
,
"2.27 MiB"
},
{
2192
,
"2.14 KiB"
},
{
12
,
"12.00 B"
},
...
...
@@ -36,3 +38,22 @@ func TestStorageSizeString(t *testing.T) {
}
}
}
func
TestStorageSizeTerminalString
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
size
StorageSize
str
string
}{
{
2839274474874
,
"2.58TiB"
},
{
2458492810
,
"2.29GiB"
},
{
2381273
,
"2.27MiB"
},
{
2192
,
"2.14KiB"
},
{
12
,
"12.00B"
},
}
for
_
,
test
:=
range
tests
{
if
test
.
size
.
TerminalString
()
!=
test
.
str
{
t
.
Errorf
(
"%f: got %q, want %q"
,
float64
(
test
.
size
),
test
.
size
.
TerminalString
(),
test
.
str
)
}
}
}
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