Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/TestAuxUtilities.java @ 558:154718ae23ed
Annotate: refactor/reuse range handling code
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 25 Feb 2013 18:41:44 +0100 |
parents | 45751456b471 |
children | 88afffd39899 |
comparison
equal
deleted
inserted
replaced
557:b9e5ac26dd83 | 558:154718ae23ed |
---|---|
31 import org.tmatesoft.hg.core.HgCatCommand; | 31 import org.tmatesoft.hg.core.HgCatCommand; |
32 import org.tmatesoft.hg.core.Nodeid; | 32 import org.tmatesoft.hg.core.Nodeid; |
33 import org.tmatesoft.hg.internal.ArrayHelper; | 33 import org.tmatesoft.hg.internal.ArrayHelper; |
34 import org.tmatesoft.hg.internal.IntVector; | 34 import org.tmatesoft.hg.internal.IntVector; |
35 import org.tmatesoft.hg.internal.PathScope; | 35 import org.tmatesoft.hg.internal.PathScope; |
36 import org.tmatesoft.hg.internal.RangeSeq; | |
36 import org.tmatesoft.hg.internal.RevisionDescendants; | 37 import org.tmatesoft.hg.internal.RevisionDescendants; |
37 import org.tmatesoft.hg.repo.HgChangelog; | 38 import org.tmatesoft.hg.repo.HgChangelog; |
38 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 39 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
39 import org.tmatesoft.hg.repo.HgDataFile; | 40 import org.tmatesoft.hg.repo.HgDataFile; |
40 import org.tmatesoft.hg.repo.HgManifest; | 41 import org.tmatesoft.hg.repo.HgManifest; |
526 for (int i = 0; i < v.size(); i++) { | 527 for (int i = 0; i < v.size(); i++) { |
527 errorCollector.assertEquals(i+1, v.get(i)); | 528 errorCollector.assertEquals(i+1, v.get(i)); |
528 } | 529 } |
529 } | 530 } |
530 | 531 |
532 @Test | |
533 public void testRangeSequence() { | |
534 RangeSeq rs = new RangeSeq(); | |
535 rs.add(-1, 5, 3); | |
536 rs.add(-1, 10, 2); | |
537 rs.add(-1, 15, 3); | |
538 rs.add(-1, 20, 3); | |
539 errorCollector.assertFalse(rs.includesTargetLine(4)); | |
540 errorCollector.assertTrue(rs.includesTargetLine(7)); | |
541 errorCollector.assertFalse(rs.includesTargetLine(8)); | |
542 errorCollector.assertTrue(rs.includesTargetLine(10)); | |
543 errorCollector.assertFalse(rs.includesTargetLine(12)); | |
544 } | |
545 | |
531 | 546 |
532 public static void main(String[] args) throws Exception { | 547 public static void main(String[] args) throws Exception { |
533 new TestAuxUtilities().testRepositoryConfig(); | 548 new TestAuxUtilities().testRepositoryConfig(); |
534 } | 549 } |
535 } | 550 } |