func parseWithTemplate(t *testing.T, query string, tmpl string, expected *Scope, rType Type) *Sparql {
    s := &Sparql{ Buffer : query, Scope : NewScopeWithTemplate(tmpl) }
    s.Init()
    parseWithSparql(t, s, expected, rType)
    return s
}
Like parse but pass a custom query recommendation template
package autocompletion
import (
    "testing"
    "bytes"
)
func (td *Scope) add(s string, p string, o string) {
    td.Tps = append(td.Tps, triplePattern{ S : s, P : p, O : o })
}
func (td *Scope) addLeaf(s string, p string, o string) {
    td.Tps = append(td.Tps, triplePattern{ S : s, P : p, O : o, Leaf : true })
}
func parse(t *testing.T, query string, expected *Scope, rType Type) *Sparql {
    s := &Sparql{ Buffer : query, Scope : NewScope() }
    s.Init()
    parseWithSparql(t, s, expected, rType)
    return s
}