(t *testing.T)
| 145 | } |
| 146 | |
| 147 | func TestCellIDFromString(t *testing.T) { |
| 148 | tests := []struct { |
| 149 | have string |
| 150 | want CellID |
| 151 | }{ |
| 152 | {have: "3/", want: CellIDFromFace(3)}, |
| 153 | {have: "0/21", want: CellIDFromFace(0).Children()[2].Children()[1]}, |
| 154 | {have: "4/000000000000000000000000000000", want: CellIDFromFace(4).RangeMin()}, |
| 155 | {have: "4/0000000000000000000000000000000", want: 0}, |
| 156 | {have: "", want: 0}, |
| 157 | {have: "7/", want: 0}, |
| 158 | {have: " /", want: 0}, |
| 159 | {have: "3:0", want: 0}, |
| 160 | {have: "3/ 12", want: 0}, |
| 161 | {have: "3/1241", want: 0}, |
| 162 | } |
| 163 | |
| 164 | for _, test := range tests { |
| 165 | if got := CellIDFromString(test.have); got != test.want { |
| 166 | t.Errorf("CellIDFromString(%q) = %v, want %v", test.have, got, test.want) |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestCellIDLatLng(t *testing.T) { |
| 172 | // You can generate these with the s2cellid2latlngtestcase C++ program in this directory. |
nothing calls this directly
no test coverage detected
searching dependent graphs…