MCPcopy
hub / github.com/google/mangle / TestWithinDistanceError

Function TestWithinDistanceError

builtin/builtin_test.go:243–253  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

241}
242
243func TestWithinDistanceError(t *testing.T) {
244 atom := ast.NewAtom(":within_distance", ast.String("hello"), ast.Number(2), ast.Number(2))
245 if got, _, err := Decide(atom, &emptySubst); err == nil { // if no error
246 t.Errorf("Decide(%v)=%v want error", atom, got)
247 }
248
249 invalid := ast.NewAtom(":within_distance", ast.Number(2), ast.Number(2))
250 if got, _, err := Decide(invalid, &emptySubst); err == nil { // if no error
251 t.Errorf("Decide(%v)=%v want error", invalid, got)
252 }
253}
254
255func TestMatchPrefix(t *testing.T) {
256 tests := []struct {

Callers

nothing calls this directly

Calls 4

NewAtomFunction · 0.92
StringFunction · 0.92
NumberFunction · 0.92
DecideFunction · 0.85

Tested by

no test coverage detected