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

Function TestDifferQFormat

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

Source from the content-addressed store, hash-verified

581}
582
583func TestDifferQFormat(t *testing.T) {
584 diff := NewDiffer()
585 aStr := "\tfoo2bar\n"
586 aTag := " ^ ^"
587 bStr := "\tfoo3baz\n"
588 bTag := " ^ ^"
589 out := diff.QFormat(aStr, bStr, aTag, bTag)
590 if reflect.DeepEqual(out, []string{
591 "- \tfoo2bar\n",
592 "? \t ^ ^\n",
593 "+ \tfoo3baz\n",
594 "? \t ^ ^\n",
595 }) != true {
596 t.Fatal("Differ QFormat() failure:", out)
597 }
598}
599
600func TestGetUnifiedDiffString(t *testing.T) {
601 A := "one\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\nten\n"

Callers

nothing calls this directly

Calls 2

QFormatMethod · 0.95
NewDifferFunction · 0.70

Tested by

no test coverage detected