snapshot of https://github.com/blevesearch/bleve.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
Coverage / coverage (push) Failing after 6s
Tests / test (1.24.x, ubuntu-latest) (push) Failing after 42s
Tests / test (1.26.x, ubuntu-latest) (push) Failing after 38s
Tests / test (1.25.x, ubuntu-latest) (push) Failing after 35s
Tests / test (1.25.x, windows-latest) (push) Has been cancelled
Tests / test (1.26.x, macos-latest) (push) Has been cancelled
Tests / test (1.26.x, windows-latest) (push) Has been cancelled
Tests / test (1.24.x, macos-latest) (push) Has been cancelled
Tests / test (1.24.x, windows-latest) (push) Has been cancelled
Tests / test (1.25.x, macos-latest) (push) Has been cancelled
Some checks failed
Coverage / coverage (push) Failing after 6s
Tests / test (1.24.x, ubuntu-latest) (push) Failing after 42s
Tests / test (1.26.x, ubuntu-latest) (push) Failing after 38s
Tests / test (1.25.x, ubuntu-latest) (push) Failing after 35s
Tests / test (1.25.x, windows-latest) (push) Has been cancelled
Tests / test (1.26.x, macos-latest) (push) Has been cancelled
Tests / test (1.26.x, windows-latest) (push) Has been cancelled
Tests / test (1.24.x, macos-latest) (push) Has been cancelled
Tests / test (1.24.x, windows-latest) (push) Has been cancelled
Tests / test (1.25.x, macos-latest) (push) Has been cancelled
This commit is contained in:
47
mapping/reflect_test.go
Normal file
47
mapping/reflect_test.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package mapping
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLookupPropertyPath(t *testing.T) {
|
||||
tests := []struct {
|
||||
input interface{}
|
||||
path string
|
||||
output interface{}
|
||||
}{
|
||||
{
|
||||
input: map[string]interface{}{
|
||||
"Type": "a",
|
||||
},
|
||||
path: "Type",
|
||||
output: "a",
|
||||
},
|
||||
{
|
||||
input: struct {
|
||||
Type string
|
||||
}{
|
||||
Type: "b",
|
||||
},
|
||||
path: "Type",
|
||||
output: "b",
|
||||
},
|
||||
{
|
||||
input: &struct {
|
||||
Type string
|
||||
}{
|
||||
Type: "b",
|
||||
},
|
||||
path: "Type",
|
||||
output: "b",
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
actual := lookupPropertyPath(test.input, test.path)
|
||||
if !reflect.DeepEqual(actual, test.output) {
|
||||
t.Fatalf("expected '%v', got '%v', for path '%s' in %+v", test.output, actual, test.path, test.input)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user