MCPcopy Create free account
hub / github.com/cogentcore/core / TestDifferCompare

Function TestDifferCompare

texteditor/difflib/difflib_test.go:473–492  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

471}
472
473func TestDifferCompare(t *testing.T) {
474 diff := NewDiffer()
475 // Test
476 aLst := []string{"foo\n", "bar\n", "baz\n"}
477 bLst := []string{"foo\n", "bar1\n", "asdf\n", "baz\n"}
478 out, err := diff.Compare(aLst, bLst)
479 if err != nil {
480 t.Fatal("Differ Compare() error:", err)
481 }
482 if reflect.DeepEqual(out, []string{
483 " foo\n",
484 "- bar\n",
485 "+ bar1\n",
486 "? +\n",
487 "+ asdf\n",
488 " baz\n",
489 }) != true {
490 t.Fatal("Differ Compare failure:", out)
491 }
492}
493
494func TestDifferStructuredDump(t *testing.T) {
495 diff := NewDiffer()

Callers

nothing calls this directly

Calls 2

CompareMethod · 0.95
NewDifferFunction · 0.70

Tested by

no test coverage detected