Home | History | Annotate | Download | only in Tooling

Lines Matching refs:Range

155   // location being in the range ]a, z[.
439 TEST(Range, overlaps) {
440 EXPECT_TRUE(Range(10, 10).overlapsWith(Range(0, 11)));
441 EXPECT_TRUE(Range(0, 11).overlapsWith(Range(10, 10)));
442 EXPECT_FALSE(Range(10, 10).overlapsWith(Range(0, 10)));
443 EXPECT_FALSE(Range(0, 10).overlapsWith(Range(10, 10)));
444 EXPECT_TRUE(Range(0, 10).overlapsWith(Range(2, 6)));
445 EXPECT_TRUE(Range(2, 6).overlapsWith(Range(0, 10)));
448 TEST(Range, contains) {
449 EXPECT_TRUE(Range(0, 10).contains(Range(0, 10)));
450 EXPECT_TRUE(Range(0, 10).contains(Range(2, 6)));
451 EXPECT_FALSE(Range(2, 6).contains(Range(0, 10)));
452 EXPECT_FALSE(Range(0, 10).contains(Range(0, 11)));
455 TEST(Range, CalculateRangesOfReplacements) {
463 std::vector<Range> Ranges = calculateChangedRanges(Replaces);
472 TEST(Range, RangesAfterReplacements) {
473 std::vector<Range> Ranges = {Range(5, 2), Range(10, 5)};
475 std::vector<Range> Expected = {Range(0, 4), Range(7, 2), Range(12, 5)};
479 TEST(Range, RangesBeforeReplacements) {
480 std::vector<Range> Ranges = {Range(5, 2), Range(10, 5)};
482 std::vector<Range> Expected = {Range(5, 2), Range(10, 5), Range(20, 4)};
486 TEST(Range, NotAffectedByReplacements) {
487 std::vector<Range> Ranges = {Range(0, 2), Range(5, 2), Range(10, 5)};
491 std::vector<Range> Expected = {Range(0, 2), Range(3, 4), Range(10, 5),
492 Range(20, 0)};
496 TEST(Range, RangesWithNonOverlappingReplacements) {
497 std::vector<Range> Ranges = {Range(0, 2), Range(5, 2), Range(10, 5)};
501 std::vector<Range> Expected = {Range(0, 2), Range(3, 0), Range(4, 4),
502 Range(11, 5), Range(21, 5)};
506 TEST(Range, RangesWithOverlappingReplacements) {
507 std::vector<Range> Ranges = {Range(0, 2), Range(5, 2), Range(15, 5),
508 Range(30, 5)};
512 std::vector<Range> Expected = {Range(0, 1), Range(2, 4), Range(12, 5),
513 Range(22, 0)};
517 TEST(Range, MergeIntoOneRange) {
518 std::vector<Range> Ranges = {Range(0, 2), Range(5, 2), Range(15, 5)};
520 std::vector<Range> Expected = {Range(0, 15)};
524 TEST(Range, ReplacementsStartingAtRangeOffsets) {
525 std::vector<Range> Ranges = {Range(0, 2), Range(5, 5), Range(15, 5)};
529 std::vector<Range> Expected = {Range(0, 2), Range(5, 9), Range(18, 2)};
533 TEST(Range, ReplacementsEndingAtRangeEnds) {
534 std::vector<Range> Ranges = {Range(0, 2), Range(5, 2), Range(15, 5)};
537 std::vector<Range> Expected = {Range(0, 2), Range(5, 4), Range(17, 4)};
541 TEST(Range, AjacentReplacements) {
542 std::vector<Range> Ranges = {Range(0, 0), Range(15, 5)};
545 std::vector<Range> Expected = {Range(0, 0), Range(1, 3), Range(13, 9)};
549 TEST(Range, MergeRangesAfterReplacements) {
550 std::vector<Range> Ranges = {Range(8, 0), Range(5, 2), Range(9, 0), Range(0, 1)};
553 std::vector<Range> Expected = {Range(0, 1), Range(2, 4), Range(7, 0), Range(8, 0)};
581 std::vector<Range> Conflicts; // Ignored for this test
597 std::vector<Range> Conflicts;
601 // conflicted range.
622 // Replacement. #4 ensures #3 hasn't messed up the conflicting range size.
624 std::vector<Range> Conflicts;