| 187 | } |
| 188 | |
| 189 | func TestDecodeError_Accessors(t *testing.T) { |
| 190 | e := DecodeError{ |
| 191 | message: "foo", |
| 192 | line: 1, |
| 193 | column: 2, |
| 194 | key: []string{"one", "two"}, |
| 195 | human: "bar", |
| 196 | } |
| 197 | assert.Equal(t, "toml: foo", e.Error()) |
| 198 | r, c := e.Position() |
| 199 | assert.Equal(t, 1, r) |
| 200 | assert.Equal(t, 2, c) |
| 201 | assert.Equal(t, Key{"one", "two"}, e.Key()) |
| 202 | assert.Equal(t, "bar", e.String()) |
| 203 | } |
| 204 | |
| 205 | func TestDecodeError_DuplicateContent(t *testing.T) { |
| 206 | // This test verifies that when the same content appears multiple times |