mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 19:57:40 +08:00
unit testing files renaming
This commit is contained in:
parent
732664a1ff
commit
57ccc13e0c
@ -8,11 +8,6 @@ package garray
|
||||
|
||||
import "strings"
|
||||
|
||||
// iInterfaces is used for type assert api for Interfaces.
|
||||
type iInterfaces interface {
|
||||
Interfaces() []interface{}
|
||||
}
|
||||
|
||||
// defaultComparatorInt for int comparison.
|
||||
func defaultComparatorInt(a, b int) int {
|
||||
if a < b {
|
||||
|
@ -31,7 +31,7 @@ func ExampleStrArray_Walk() {
|
||||
// [gf_user gf_user_detail]
|
||||
}
|
||||
|
||||
func ExampleStrArray_NewStrArray() {
|
||||
func ExampleNewStrArray() {
|
||||
s := garray.NewStrArray()
|
||||
s.Append("We")
|
||||
s.Append("are")
|
||||
@ -43,7 +43,7 @@ func ExampleStrArray_NewStrArray() {
|
||||
// [We are GF fans]
|
||||
}
|
||||
|
||||
func ExampleStrArray_NewStrArraySize() {
|
||||
func ExampleNewStrArraySize() {
|
||||
s := garray.NewStrArraySize(3, 5)
|
||||
s.Set(0, "We")
|
||||
s.Set(1, "are")
|
||||
@ -55,7 +55,7 @@ func ExampleStrArray_NewStrArraySize() {
|
||||
// [We are GF] 3 5
|
||||
}
|
||||
|
||||
func ExampleStrArray_NewStrArrayFrom() {
|
||||
func ExampleNewStrArrayFrom() {
|
||||
s := garray.NewStrArrayFrom(g.SliceStr{"We", "are", "GF", "fans", "!"})
|
||||
fmt.Println(s.Slice(), s.Len(), cap(s.Slice()))
|
||||
|
||||
@ -63,14 +63,6 @@ func ExampleStrArray_NewStrArrayFrom() {
|
||||
// [We are GF fans !] 5 5
|
||||
}
|
||||
|
||||
func ExampleStrArray_NewStrArrayFromCopy() {
|
||||
s := garray.NewStrArrayFromCopy(g.SliceStr{"We", "are", "GF", "fans", "!"})
|
||||
fmt.Println(s.Slice(), s.Len(), cap(s.Slice()))
|
||||
|
||||
// Output:
|
||||
// [We are GF fans !] 5 5
|
||||
}
|
||||
|
||||
func ExampleStrArray_At() {
|
||||
s := garray.NewStrArrayFrom(g.SliceStr{"We", "are", "GF", "fans", "!"})
|
||||
sAt := s.At(2)
|
@ -1,26 +0,0 @@
|
||||
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
|
||||
package ghttp_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/os/genv"
|
||||
)
|
||||
|
||||
var (
|
||||
ctx = context.TODO()
|
||||
ports = garray.NewIntArray(true)
|
||||
)
|
||||
|
||||
func init() {
|
||||
genv.Set("UNDER_TEST", "1")
|
||||
for i := 7000; i <= 8000; i++ {
|
||||
ports.Append(i)
|
||||
}
|
||||
}
|
@ -7,15 +7,30 @@
|
||||
package ghttp_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/os/genv"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
)
|
||||
|
||||
var (
|
||||
ctx = context.TODO()
|
||||
ports = garray.NewIntArray(true)
|
||||
)
|
||||
|
||||
func init() {
|
||||
genv.Set("UNDER_TEST", "1")
|
||||
for i := 7000; i <= 8000; i++ {
|
||||
ports.Append(i)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_GetUrl(t *testing.T) {
|
||||
p, _ := ports.PopRand()
|
||||
s := g.Server(p)
|
@ -1,21 +0,0 @@
|
||||
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
|
||||
package gudp_test
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
)
|
||||
|
||||
var (
|
||||
ports = garray.NewIntArray(true)
|
||||
)
|
||||
|
||||
func init() {
|
||||
for i := 9000; i <= 10000; i++ {
|
||||
ports.Append(i)
|
||||
}
|
||||
}
|
@ -12,12 +12,23 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/container/garray"
|
||||
"github.com/gogf/gf/v2/net/gudp"
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
)
|
||||
|
||||
var (
|
||||
ports = garray.NewIntArray(true)
|
||||
)
|
||||
|
||||
func init() {
|
||||
for i := 9000; i <= 10000; i++ {
|
||||
ports.Append(i)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_Basic(t *testing.T) {
|
||||
var (
|
||||
ctx = context.TODO()
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user