func iteratedNames(qs graph.QuadStore, it graph.Iterator) []string { var res []string for graph.Next(it) { res = append(res, qs.NameOf(it.Result())) } sort.Strings(res) return res }
func IteratedValues(t testing.TB, qs graph.QuadStore, it graph.Iterator) []quad.Value { var res []quad.Value for it.Next() { res = append(res, qs.NameOf(it.Result())) } require.Nil(t, it.Err()) sort.Sort(quad.ByValueString(res)) return res }
func IteratedRawStrings(t testing.TB, qs graph.QuadStore, it graph.Iterator) []string { var res []string for it.Next() { res = append(res, qs.NameOf(it.Result()).String()) } require.Nil(t, it.Err()) sort.Strings(res) return res }
func iterateResults(qs graph.QuadStore, it graph.Iterator) []string { var res []string for graph.Next(it) { v := it.Result() if t, ok := v.(*Token); ok && t.Kind == nodeKind { res = append(res, qs.NameOf(it.Result())) } else { res = append(res, qs.Quad(it.Result()).String()) } } sort.Strings(res) it.Reset() return res }