MCPcopy Create free account
hub / github.com/sergi/go-diff / TestDiffCleanupSemanticScore

Function TestDiffCleanupSemanticScore

diffmatchpatch/diff_test.go:478–488  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

476}
477
478func TestDiffCleanupSemanticScore(t *testing.T) {
479 assert.Equal(t, 6, diffCleanupSemanticScore("", "AAA"))
480 assert.Equal(t, 5, diffCleanupSemanticScore("AAA\n\n", "BBB"))
481 assert.Equal(t, 5, diffCleanupSemanticScore("AAA", "\n\nBBB"))
482 assert.Equal(t, 5, diffCleanupSemanticScore("AAA", "\r\n\r\nBBB"))
483 assert.Equal(t, 4, diffCleanupSemanticScore("AAA\n", "BBB"))
484 assert.Equal(t, 3, diffCleanupSemanticScore("AAA.", " BBB"))
485 assert.Equal(t, 2, diffCleanupSemanticScore("AAA", " BBB"))
486 assert.Equal(t, 1, diffCleanupSemanticScore("AAA", "-BBB"))
487 assert.Equal(t, 0, diffCleanupSemanticScore("AAA", "BBB"))
488}
489
490func TestDiffCleanupSemanticLossless(t *testing.T) {
491 type TestCase struct {

Callers

nothing calls this directly

Calls 1

diffCleanupSemanticScoreFunction · 0.85

Tested by

no test coverage detected