Skip to content

Commit

Permalink
Merge pull request #3 from dsidirop/ksidirop/NTOP-0053-flag-to-displa…
Browse files Browse the repository at this point in the history
…y-raw-bytes

nats-io#53 new cli-flag '-b' to display raw bytes
  • Loading branch information
dsidirop authored Feb 7, 2022
2 parents d2e1879 + 884c494 commit c0c8c1f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions util/toputils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,31 @@ func TestPsize(t *testing.T) {
want string
}{
{
description: "given input=1023 and display_raw_bytes=false expect return value string to be '1023'",
description: "given input 1023 and display_raw_bytes false expect return value string to be '1023'",
args: Args{
input: int64(1023),
displayRawBytes: false,
},
want: "1023",
},
{
description: "given input=kibibyte and display_raw_bytes=false expect return value string to be '1.0K'",
description: "given input kibibyte and display_raw_bytes false expect return value string to be '1.0K'",
args: Args{
input: int64(kibibyte),
displayRawBytes: false,
},
want: "1.0K",
},
{
description: "given input=mebibyte and display_raw_bytes=false expect return value string to be '1.0M'",
description: "given input mebibyte and display_raw_bytes false expect return value string to be '1.0M'",
args: Args{
input: int64(mebibyte),
displayRawBytes: false,
},
want: "1.0M",
},
{
description: "given input=gibibyte and display_raw_bytes=false expect return value string to be '1.0G'",
description: "given input gibibyte and display_raw_bytes false expect return value string to be '1.0G'",
args: Args{
input: int64(gibibyte),
displayRawBytes: false,
Expand All @@ -145,31 +145,31 @@ func TestPsize(t *testing.T) {
},

{
description: "given input=1023 and display_raw_bytes=true expect return value string to be '1023'",
description: "given input 1023 and display_raw_bytes true expect return value string to be '1023'",
args: Args{
input: int64(1023),
displayRawBytes: true,
},
want: "1023",
},
{
description: "given input=kibibyte and display_raw_bytes=true expect return value string to be '1048576'",
description: "given input kibibyte and display_raw_bytes true expect return value string to be '1048576'",
args: Args{
input: int64(kibibyte),
displayRawBytes: true,
},
want: fmt.Sprintf("%d", kibibyte),
},
{
description: "given input=mebibyte and display_raw_bytes=true expect return value string to be '1048576'",
description: "given input mebibyte and display_raw_bytes true expect return value string to be '1048576'",
args: Args{
input: int64(mebibyte),
displayRawBytes: true,
},
want: fmt.Sprintf("%d", mebibyte),
},
{
description: "given input=gibibyte and display_raw_bytes=true expect return value string to be '1073741824'",
description: "given input gibibyte and display_raw_bytes true expect return value string to be '1073741824'",
args: Args{
input: int64(gibibyte),
displayRawBytes: true,
Expand Down

0 comments on commit c0c8c1f

Please sign in to comment.