MCPcopy
hub / github.com/google/go-cmp / TestDifference

Function TestDifference

cmp/internal/diff/diff_test.go:15–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestDifference(t *testing.T) {
16 tests := []struct {
17 // Before passing x and y to Difference, we strip all spaces so that
18 // they can be used by the test author to indicate a missing symbol
19 // in one of the lists.
20 x, y string
21 want string // '|' separated list of possible outputs
22 }{{
23 x: "",
24 y: "",
25 want: "",
26 }, {
27 x: "#",
28 y: "#",
29 want: ".",
30 }, {
31 x: "##",
32 y: "# ",
33 want: ".X|X.",
34 }, {
35 x: "a#",
36 y: "A ",
37 want: "MX",
38 }, {
39 x: "#a",
40 y: " A",
41 want: "XM",
42 }, {
43 x: "# ",
44 y: "##",
45 want: ".Y|Y.",
46 }, {
47 x: " #",
48 y: "@#",
49 want: "Y.",
50 }, {
51 x: "@#",
52 y: " #",
53 want: "X.",
54 }, {
55 x: "##########0123456789",
56 y: " 0123456789",
57 want: "XXXXXXXXXX..........",
58 }, {
59 x: " 0123456789",
60 y: "##########0123456789",
61 want: "YYYYYYYYYY..........",
62 }, {
63 x: "#####0123456789#####",
64 y: " 0123456789 ",
65 want: "XXXXX..........XXXXX",
66 }, {
67 x: " 0123456789 ",
68 y: "#####0123456789#####",
69 want: "YYYYY..........YYYYY",
70 }, {
71 x: "01234##########56789",
72 y: "01234 56789",

Callers

nothing calls this directly

Calls 3

testStringsFunction · 0.85
StringMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected