MCPcopy
hub / github.com/hashicorp/hcl / TestRangePartitionAround

Function TestRangePartitionAround

pos_test.go:313–443  ·  pos_test.go::TestRangePartitionAround
(t *testing.T)

Source from the content-addressed store, hash-verified

311}
312
313func TestRangePartitionAround(t *testing.T) {
314 tests := []struct {
315 Outer Range
316 Inner Range
317 WantBefore Range
318 WantOverlap Range
319 WantAfter Range
320 }{
321 {
322 Range{ // ##
323 Start: Pos{Byte: 2, Line: 1, Column: 3},
324 End: Pos{Byte: 4, Line: 1, Column: 5},
325 },
326 Range{ // ####
327 Start: Pos{Byte: 1, Line: 1, Column: 2},
328 End: Pos{Byte: 5, Line: 1, Column: 6},
329 },
330 Range{ // (empty)
331 Start: Pos{Byte: 2, Line: 1, Column: 3},
332 End: Pos{Byte: 2, Line: 1, Column: 3},
333 },
334 Range{ // ##
335 Start: Pos{Byte: 2, Line: 1, Column: 3},
336 End: Pos{Byte: 4, Line: 1, Column: 5},
337 },
338 Range{ // (empty)
339 Start: Pos{Byte: 4, Line: 1, Column: 5},
340 End: Pos{Byte: 4, Line: 1, Column: 5},
341 },
342 },
343 {
344 Range{ // ####
345 Start: Pos{Byte: 0, Line: 1, Column: 1},
346 End: Pos{Byte: 4, Line: 1, Column: 5},
347 },
348 Range{ // ####
349 Start: Pos{Byte: 1, Line: 1, Column: 2},
350 End: Pos{Byte: 5, Line: 1, Column: 6},
351 },
352 Range{ // #
353 Start: Pos{Byte: 0, Line: 1, Column: 1},
354 End: Pos{Byte: 1, Line: 1, Column: 2},
355 },
356 Range{ // ###
357 Start: Pos{Byte: 1, Line: 1, Column: 2},
358 End: Pos{Byte: 4, Line: 1, Column: 5},
359 },
360 Range{ // (empty)
361 Start: Pos{Byte: 4, Line: 1, Column: 5},
362 End: Pos{Byte: 4, Line: 1, Column: 5},
363 },
364 },
365 {
366 Range{ // ####
367 Start: Pos{Byte: 2, Line: 1, Column: 3},
368 End: Pos{Byte: 5, Line: 1, Column: 6},
369 },
370 Range{ // ####

Callers

nothing calls this directly

Calls 3

visRangeOffsetsFunction · 0.85
RunMethod · 0.80
PartitionAroundMethod · 0.80

Tested by

no test coverage detected