MCPcopy Create free account
hub / github.com/cogentcore/core / TestSplitLines

Function TestSplitLines

texteditor/difflib/difflib_test.go:405–417  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

403}
404
405func TestSplitLines(t *testing.T) {
406 allTests := []struct {
407 input string
408 want []string
409 }{
410 {"foo", []string{"foo\n"}},
411 {"foo\nbar", []string{"foo\n", "bar\n"}},
412 {"foo\nbar\n", []string{"foo\n", "bar\n", "\n"}},
413 }
414 for _, test := range allTests {
415 assertEqual(t, SplitLines(test.input), test.want)
416 }
417}
418
419func benchmarkSplitLines(b *testing.B, count int) {
420 str := strings.Repeat("foo\n", count)

Callers

nothing calls this directly

Calls 2

assertEqualFunction · 0.70
SplitLinesFunction · 0.70

Tested by

no test coverage detected