MCPcopy
hub / github.com/expr-lang/expr / TestSplitLines

Function TestSplitLines

internal/difflib/difflib_test.go:395–407  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

393}
394
395func TestSplitLines(t *testing.T) {
396 allTests := []struct {
397 input string
398 want []string
399 }{
400 {"foo", []string{"foo\n"}},
401 {"foo\nbar", []string{"foo\n", "bar\n"}},
402 {"foo\nbar\n", []string{"foo\n", "bar\n", "\n"}},
403 }
404 for _, test := range allTests {
405 assertEqual(t, SplitLines(test.input), test.want)
406 }
407}
408
409func benchmarkSplitLines(b *testing.B, count int) {
410 str := strings.Repeat("foo\n", count)

Callers

nothing calls this directly

Calls 2

assertEqualFunction · 0.85
SplitLinesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…