Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/TestDirstate.java @ 609:e4a71afd3c71
Test TODOs: test for ConfigFile (covering %include and %unset directives)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 08 May 2013 17:11:45 +0200 |
parents | 2813a26b8999 |
children |
comparison
equal
deleted
inserted
replaced
608:e1b29756f901 | 609:e4a71afd3c71 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011-2012 TMate Software Ltd | 2 * Copyright (c) 2011-2013 TMate Software Ltd |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License as published by | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; version 2 of the License. | 6 * the Free Software Foundation; version 2 of the License. |
7 * | 7 * |
15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
16 */ | 16 */ |
17 package org.tmatesoft.hg.test; | 17 package org.tmatesoft.hg.test; |
18 | 18 |
19 import static java.lang.Character.*; | 19 import static java.lang.Character.*; |
20 import static org.junit.Assert.assertTrue; | 20 import static org.junit.Assert.*; |
21 import static org.junit.Assert.fail; | |
22 | 21 |
23 import java.util.TreeSet; | 22 import java.util.TreeSet; |
24 | 23 |
25 import org.junit.Assert; | 24 import org.junit.Assert; |
26 import org.junit.Test; | 25 import org.junit.Test; |
44 | 43 |
45 @Test | 44 @Test |
46 public void testParents() throws Exception { | 45 public void testParents() throws Exception { |
47 repo = Configuration.get().find("log-branches"); | 46 repo = Configuration.get().find("log-branches"); |
48 final Pair<Nodeid, Nodeid> wcParents = repo.getWorkingCopyParents(); | 47 final Pair<Nodeid, Nodeid> wcParents = repo.getWorkingCopyParents(); |
49 Assert.assertEquals("5f24ef64e9dfb1540db524f88cb5c3d265e1a3b5", wcParents.first().toString()); | 48 assertEquals("5f24ef64e9dfb1540db524f88cb5c3d265e1a3b5", wcParents.first().toString()); |
50 Assert.assertTrue(wcParents.second().isNull()); | 49 assertTrue(wcParents.second().isNull()); |
51 // | 50 // |
52 // TODO same static and non-static | 51 HgDirstate ds = new HgInternals(repo).getDirstate(); |
52 final Pair<Nodeid, Nodeid> wcParents2 = ds.parents(); | |
53 assertEquals(wcParents.first(), wcParents2.first()); | |
54 assertEquals(wcParents.second(), wcParents2.second()); | |
53 } | 55 } |
54 | 56 |
55 @Test | 57 @Test |
56 public void testParentsEmptyRepo() throws Exception { | 58 public void testParentsEmptyRepo() throws Exception { |
57 // check contract return values for empty/nonexistent dirstate | 59 // check contract return values for empty/nonexistent dirstate |