MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / parseNquads

Function parseNquads

dql/parser_test.go:4876–4890  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

4874}
4875
4876func parseNquads(b []byte) ([]*api.NQuad, error) {
4877 var lexer lex.Lexer
4878 var nqs []*api.NQuad
4879 for _, line := range bytes.Split(b, []byte{'\n'}) {
4880 nq, err := chunker.ParseRDF(string(line), &lexer)
4881 if err == chunker.ErrEmpty {
4882 continue
4883 }
4884 if err != nil {
4885 return nil, err
4886 }
4887 nqs = append(nqs, &nq)
4888 }
4889 return nqs, nil
4890}
4891
4892func TestParseMutation(t *testing.T) {
4893 m := `

Callers 1

TestParseMutationFunction · 0.85

Calls 1

ParseRDFFunction · 0.92

Tested by

no test coverage detected