mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-26 12:16:40 +08:00
套餐可以设置带宽限制
This commit is contained in:
27
pkg/serverconfigs/shared/bit_size_capacity_test.go
Normal file
27
pkg/serverconfigs/shared/bit_size_capacity_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
|
||||
package shared_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestBitSizeCapacity_Bits(t *testing.T) {
|
||||
{
|
||||
var capacity = shared.NewBitSizeCapacity(1, shared.BitSizeCapacityUnitB)
|
||||
t.Log(capacity.Bits())
|
||||
}
|
||||
{
|
||||
var capacity = shared.NewBitSizeCapacity(2, shared.BitSizeCapacityUnitKB)
|
||||
t.Log(capacity.Bits())
|
||||
}
|
||||
{
|
||||
var capacity = shared.NewBitSizeCapacity(3, shared.BitSizeCapacityUnitMB)
|
||||
t.Log(capacity.Bits())
|
||||
}
|
||||
{
|
||||
var capacity = shared.NewBitSizeCapacity(4, shared.BitSizeCapacityUnitGB)
|
||||
t.Log(capacity.Bits())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user