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

Function TestFreqHandlesLongLines

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

Source from the content-addressed store, hash-verified

595}
596
597func TestFreqHandlesLongLines(t *testing.T) {
598 t.Parallel()
599 got, err := script.Echo(longLine).Freq().Slice()
600 if err != nil {
601 t.Fatal(err)
602 }
603 if len(got) != 2 {
604 t.Fatalf("want 2 results, got %d: %q", len(got), got)
605 }
606 if got[0] != "1 last line" {
607 t.Fatalf("wrong result: %q", got)
608 }
609}
610
611func TestFreqProducesCorrectFrequencyTableForInput(t *testing.T) {
612 t.Parallel()

Callers

nothing calls this directly

Calls 3

EchoFunction · 0.92
SliceMethod · 0.80
FreqMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…