(t *testing.T)
| 1089 | } |
| 1090 | |
| 1091 | func TestClosestDocDynamicMapping(t *testing.T) { |
| 1092 | mapping := NewIndexMapping() |
| 1093 | mapping.IndexDynamic = false |
| 1094 | mapping.DefaultMapping = NewDocumentStaticMapping() |
| 1095 | mapping.DefaultMapping.AddFieldMappingsAt("foo", NewTextFieldMapping()) |
| 1096 | |
| 1097 | doc := document.NewDocument("x") |
| 1098 | err := mapping.MapDocument(doc, map[string]interface{}{ |
| 1099 | "foo": "value", |
| 1100 | "bar": map[string]string{ |
| 1101 | "foo": "value2", |
| 1102 | "baz": "value3", |
| 1103 | }, |
| 1104 | }) |
| 1105 | if err != nil { |
| 1106 | t.Fatal(err) |
| 1107 | } |
| 1108 | |
| 1109 | if len(doc.Fields) != 1 { |
| 1110 | t.Fatalf("expected 1 field, got: %d", len(doc.Fields)) |
| 1111 | } |
| 1112 | } |
| 1113 | |
| 1114 | func TestMappingPointerToTimeBug1152(t *testing.T) { |
| 1115 | when, err := time.Parse(time.RFC3339, "2019-03-06T15:04:05Z") |
nothing calls this directly
no test coverage detected
searching dependent graphs…