MCPcopy Index your code
hub / github.com/dnote/dnote / TestDo

Function TestDo

pkg/cli/utils/diff/diff_test.go:26–146  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestDo(t *testing.T) {
27 testCases := []struct {
28 s1 string
29 s2 string
30 expected []diffmatchpatch.Diff
31 }{
32 {
33 s1: "",
34 s2: "",
35 expected: []diffmatchpatch.Diff{},
36 },
37 {
38 s1: "",
39 s2: "foo",
40 expected: []diffmatchpatch.Diff{
41 {
42 Type: diffmatchpatch.DiffInsert,
43 Text: "foo",
44 },
45 },
46 },
47 {
48 s1: "foo",
49 s2: "",
50 expected: []diffmatchpatch.Diff{
51 {
52 Type: DiffDelete,
53 Text: "foo",
54 },
55 },
56 },
57 {
58 s1: "foo",
59 s2: "bar",
60 expected: []diffmatchpatch.Diff{
61 {
62 Type: DiffDelete,
63 Text: "foo",
64 },
65 {
66 Type: DiffInsert,
67 Text: "bar",
68 },
69 },
70 },
71 {
72 s1: "foo\nbar\nbaz",
73 s2: "foo\nbar\nquz",
74 expected: []diffmatchpatch.Diff{
75 {
76 Type: DiffEqual,
77 Text: "foo\nbar\n",
78 },
79 {
80 Type: DiffDelete,
81 Text: "baz",
82 },
83 {

Callers

nothing calls this directly

Calls 2

DeepEqualFunction · 0.92
DoFunction · 0.70

Tested by

no test coverage detected