MCPcopy Index your code
hub / github.com/databus23/helm-diff / TestDiffLinesLargeInput

Function TestDiffLinesLargeInput

diff/lcs_test.go:155–174  ·  view source on GitHub ↗

TestDiffLinesLargeInput ensures the implementation handles large inputs without excessive memory usage.

(t *testing.T)

Source from the content-addressed store, hash-verified

153// TestDiffLinesLargeInput ensures the implementation handles large inputs
154// without excessive memory usage.
155func TestDiffLinesLargeInput(t *testing.T) {
156 if testing.Short() {
157 t.Skip("skipping large input test in short mode")
158 }
159
160 N := 5000
161 seq1 := make([]string, N)
162 seq2 := make([]string, N)
163 for i := 0; i < N; i++ {
164 seq1[i] = fmt.Sprintf("line %d", i)
165 if i%3 == 0 {
166 seq2[i] = fmt.Sprintf("changed %d", i)
167 } else {
168 seq2[i] = seq1[i]
169 }
170 }
171
172 records := diffLines(seq1, seq2)
173 require.NotEmpty(t, records)
174}
175
176// lcsLength computes the LCS length using the standard O(N*M) DP.
177// Used only in tests to verify correctness.

Callers

nothing calls this directly

Calls 1

diffLinesFunction · 0.85

Tested by

no test coverage detected