MCPcopy Index your code
hub / github.com/expr-lang/expr / TestStringSource_SnippetSingleLine

Function TestStringSource_SnippetSingleLine

file/source_test.go:42–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestStringSource_SnippetSingleLine(t *testing.T) {
43 source := NewSource("hello, world")
44 if str, found := source.Snippet(1); !found {
45 t.Errorf(snippetNotFound, t.Name(), 1)
46 } else if str != "hello, world" {
47 t.Errorf(unexpectedSnippet, t.Name(), str, "hello, world")
48 }
49 if str2, found := source.Snippet(2); found {
50 t.Errorf(snippetFound, t.Name(), 2)
51 } else if str2 != "" {
52 t.Errorf(unexpectedSnippet, t.Name(), str2, "")
53 }
54}

Callers

nothing calls this directly

Calls 4

SnippetMethod · 0.95
NewSourceFunction · 0.85
ErrorfMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…