MCPcopy
hub / github.com/bitfield/script / TestSliceProducesElementsOfSpecifiedSliceOnePerLine

Function TestSliceProducesElementsOfSpecifiedSliceOnePerLine

script_test.go:1421–1431  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1419}
1420
1421func TestSliceProducesElementsOfSpecifiedSliceOnePerLine(t *testing.T) {
1422 t.Parallel()
1423 want := "1\n2\n3\n"
1424 got, err := script.Slice([]string{"1", "2", "3"}).String()
1425 if err != nil {
1426 t.Fatal(err)
1427 }
1428 if !cmp.Equal(want, got) {
1429 t.Error(cmp.Diff(want, got))
1430 }
1431}
1432
1433func TestSliceGivenEmptySliceProducesEmptyPipe(t *testing.T) {
1434 t.Parallel()

Callers

nothing calls this directly

Calls 3

SliceFunction · 0.92
StringMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…