(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func 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 | } |