v0.0.611 add dataext.MutexSet
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m45s
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m45s
This commit is contained in:
@@ -2,15 +2,16 @@ package wmo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/rfctime"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/timeext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
)
|
||||
|
||||
func TestReflectionGetFieldType(t *testing.T) {
|
||||
@@ -26,9 +27,10 @@ func TestReflectionGetFieldType(t *testing.T) {
|
||||
SubPtr *struct {
|
||||
A string `bson:"a"`
|
||||
} `bson:"subPtr"`
|
||||
Str string `bson:"str"`
|
||||
Ptr *int `bson:"ptr"`
|
||||
MDate rfctime.RFC3339NanoTime `bson:"mdate"`
|
||||
Str string `bson:"str"`
|
||||
Ptr *int `bson:"ptr"`
|
||||
MDate rfctime.RFC3339NanoTime `bson:"mdate"`
|
||||
ODate *rfctime.RFC3339NanoTime `bson:"odate"`
|
||||
}
|
||||
|
||||
coll := W[TestData](&mongo.Collection{})
|
||||
@@ -107,6 +109,12 @@ func TestReflectionGetFieldType(t *testing.T) {
|
||||
tst.AssertEqual(t, gft("ptr").Name, "Ptr")
|
||||
tst.AssertEqual(t, gft("ptr").IsPointer, true)
|
||||
tst.AssertEqual(t, *gfv("ptr").(*int), 4)
|
||||
|
||||
tst.AssertEqual(t, gft("odate").Kind.String(), "int")
|
||||
tst.AssertEqual(t, gft("odate").Type.String(), "int")
|
||||
tst.AssertEqual(t, gft("odate").Name, "Ptr")
|
||||
tst.AssertEqual(t, gft("odate").IsPointer, true)
|
||||
tst.AssertEqual(t, *gfv("odate").(*int), 4)
|
||||
}
|
||||
|
||||
func TestReflectionGetTokenValueAsMongoType(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user