MCPcopy
hub / github.com/dgraph-io/dgraph / indexTokensForTest

Function indexTokensForTest

posting/index_test.go:31–40  ·  view source on GitHub ↗

indexTokensForTest is just a wrapper around indexTokens used for convenience.

(attr, lang string, val types.Val)

Source from the content-addressed store, hash-verified

29
30// indexTokensForTest is just a wrapper around indexTokens used for convenience.
31func indexTokensForTest(attr, lang string, val types.Val) ([]string, error) {
32 return indexTokens(context.Background(), &indexMutationInfo{
33 tokenizers: schema.State().Tokenizer(context.Background(), x.AttrInRootNamespace(attr)),
34 edge: &pb.DirectedEdge{
35 Attr: x.AttrInRootNamespace(attr),
36 Lang: lang,
37 },
38 val: val,
39 })
40}
41
42func TestIndexingInt(t *testing.T) {
43 require.NoError(t, schema.ParseBytes([]byte("age:int @index(int) ."), 1))

Callers 8

TestIndexingIntFunction · 0.85
TestIndexingIntNegativeFunction · 0.85
TestIndexingFloatFunction · 0.85
TestIndexingTimeFunction · 0.85
TestIndexingFunction · 0.85
TestIndexingMultiLangFunction · 0.85
TestIndexingInvalidLangFunction · 0.85
TestIndexingAliasedLangFunction · 0.85

Calls 4

StateFunction · 0.92
AttrInRootNamespaceFunction · 0.92
indexTokensFunction · 0.85
TokenizerMethod · 0.80

Tested by

no test coverage detected