(t *testing.T)
| 184 | ` |
| 185 | |
| 186 | func TestSchemaIndexCustom(t *testing.T) { |
| 187 | require.NoError(t, ParseBytes([]byte(schemaIndexVal5), 1)) |
| 188 | checkSchema(t, State().predicate, []nameType{ |
| 189 | {x.AttrInRootNamespace("name"), &pb.SchemaUpdate{ |
| 190 | Predicate: x.AttrInRootNamespace("name"), |
| 191 | ValueType: pb.Posting_STRING, |
| 192 | Tokenizer: []string{"exact"}, |
| 193 | Directive: pb.SchemaUpdate_INDEX, |
| 194 | Count: true, |
| 195 | }}, |
| 196 | {x.AttrInRootNamespace("address"), &pb.SchemaUpdate{ |
| 197 | Predicate: x.AttrInRootNamespace("address"), |
| 198 | ValueType: pb.Posting_STRING, |
| 199 | Tokenizer: []string{"term"}, |
| 200 | Directive: pb.SchemaUpdate_INDEX, |
| 201 | }}, |
| 202 | {x.AttrInRootNamespace("age"), &pb.SchemaUpdate{ |
| 203 | Predicate: x.AttrInRootNamespace("age"), |
| 204 | ValueType: pb.Posting_INT, |
| 205 | Tokenizer: []string{"int"}, |
| 206 | Directive: pb.SchemaUpdate_INDEX, |
| 207 | }}, |
| 208 | {x.AttrInRootNamespace("friend"), &pb.SchemaUpdate{ |
| 209 | ValueType: pb.Posting_UID, |
| 210 | Predicate: x.AttrInRootNamespace("friend"), |
| 211 | Directive: pb.SchemaUpdate_REVERSE, |
| 212 | Count: true, |
| 213 | List: true, |
| 214 | }}, |
| 215 | }) |
| 216 | require.True(t, State().IsIndexed(context.Background(), x.AttrInRootNamespace("name"))) |
| 217 | require.False(t, State().IsReversed(context.Background(), x.AttrInRootNamespace("name"))) |
| 218 | require.Equal(t, "int", State().Tokenizer(context.Background(), x.AttrInRootNamespace("age"))[0].Name()) |
| 219 | } |
| 220 | |
| 221 | func TestParse(t *testing.T) { |
| 222 | reset() |
nothing calls this directly
no test coverage detected