(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestConciseDiffFrom(t *testing.T) { |
| 95 | for _, tt := range []struct { |
| 96 | name string |
| 97 | a, b *NetworkMap |
| 98 | want string |
| 99 | }{ |
| 100 | { |
| 101 | name: "no_change", |
| 102 | a: &NetworkMap{ |
| 103 | NodeKey: testNodeKey(1), |
| 104 | Peers: nodeViews([]*tailcfg.Node{ |
| 105 | { |
| 106 | Key: testNodeKey(2), |
| 107 | HomeDERP: 2, |
| 108 | Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"), |
| 109 | }, |
| 110 | }), |
| 111 | }, |
| 112 | b: &NetworkMap{ |
| 113 | NodeKey: testNodeKey(1), |
| 114 | Peers: nodeViews([]*tailcfg.Node{ |
| 115 | { |
| 116 | Key: testNodeKey(2), |
| 117 | HomeDERP: 2, |
| 118 | Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"), |
| 119 | }, |
| 120 | }), |
| 121 | }, |
| 122 | want: "", |
| 123 | }, |
| 124 | { |
| 125 | name: "header_change", |
| 126 | a: &NetworkMap{ |
| 127 | NodeKey: testNodeKey(1), |
| 128 | Peers: nodeViews([]*tailcfg.Node{ |
| 129 | { |
| 130 | Key: testNodeKey(2), |
| 131 | HomeDERP: 2, |
| 132 | Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"), |
| 133 | }, |
| 134 | }), |
| 135 | }, |
| 136 | b: &NetworkMap{ |
| 137 | NodeKey: testNodeKey(2), |
| 138 | Peers: nodeViews([]*tailcfg.Node{ |
| 139 | { |
| 140 | Key: testNodeKey(2), |
| 141 | HomeDERP: 2, |
| 142 | Endpoints: eps("192.168.0.100:12", "192.168.0.100:12354"), |
| 143 | }, |
| 144 | }), |
| 145 | }, |
| 146 | want: "-netmap: self: [AQEBA] auth=machine-unknown u=? []\n+netmap: self: [AgICA] auth=machine-unknown u=? []\n", |
| 147 | }, |
| 148 | { |
| 149 | name: "peer_add", |
| 150 | a: &NetworkMap{ |
| 151 | NodeKey: testNodeKey(1), |
nothing calls this directly
no test coverage detected
searching dependent graphs…