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

Function TestDifferQFormat

texteditor/difflib/bytes/bytes_test.go:641–657  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

639}
640
641func TestDifferQFormat(t *testing.T) {
642 diff := NewDiffer()
643 aStr := []byte("\tfoo2bar\n")
644 aTag := []byte(" ^ ^")
645 bStr := []byte("\tfoo3baz\n")
646 bTag := []byte(" ^ ^")
647 out := diff.QFormat(aStr, bStr, aTag, bTag)
648 out2 := bytesToStrings(out...)
649 if reflect.DeepEqual(out2, []string{
650 "- \tfoo2bar\n",
651 "? \t ^ ^\n",
652 "+ \tfoo3baz\n",
653 "? \t ^ ^\n",
654 }) != true {
655 t.Fatal("Differ QFormat() failure:", out2)
656 }
657}
658
659func TestGetUnifiedDiffString(t *testing.T) {
660 A := []byte("one\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\nten\n")

Callers

nothing calls this directly

Calls 3

QFormatMethod · 0.95
bytesToStringsFunction · 0.85
NewDifferFunction · 0.70

Tested by

no test coverage detected