chore: 并入 iotlcm-worker-svr 历史到 worker-svr/(原提交 96f0f4e)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package renewchange
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
)
|
||||
|
||||
func TestRenewableDurationOptionsAcceptsJsonNumber(t *testing.T) {
|
||||
got, err := RenewableDurationOptions(gjson.New([]any{
|
||||
json.Number("3"),
|
||||
json.Number("1"),
|
||||
json.Number("2"),
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatalf("RenewableDurationOptions returned error: %v", err)
|
||||
}
|
||||
|
||||
want := []int{1, 2, 3}
|
||||
if len(got) != len(want) {
|
||||
t.Fatalf("options = %v, want %v", got, want)
|
||||
}
|
||||
for i := range want {
|
||||
if got[i] != want[i] {
|
||||
t.Fatalf("options = %v, want %v", got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user