diff test/org/tmatesoft/hg/test/TestStatus.java @ 372:155c1893bda4

Issue 22: UnsupportedOperationException on empty manifest entry
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 06 Jan 2012 00:42:15 +0300
parents 150500515714
children 86f049e6bcae
line wrap: on
line diff
--- a/test/org/tmatesoft/hg/test/TestStatus.java	Sat Dec 31 01:04:22 2011 +0300
+++ b/test/org/tmatesoft/hg/test/TestStatus.java	Fri Jan 06 00:42:15 2012 +0300
@@ -458,6 +458,23 @@
 
 	}
 	
+	/**
+	 * Issue 22
+	 */
+	@Test
+	public void testOnEmptyRepositoryWithAllFilesDeleted() throws Exception {
+		repo = Configuration.get().find("status-2");
+		HgStatusCommand cmd = new HgStatusCommand(repo);
+		cmd.all();
+		StatusCollector sc = new StatusCollector();
+		cmd.execute(sc);
+		// shall pass without exception
+		assertTrue(sc.getErrors().isEmpty());
+		for (HgStatus.Kind k : HgStatus.Kind.values()) {
+			assertTrue("Kind " + k.name() + " shall be empty",sc.get(k).isEmpty());
+		}
+	}
+	
 	/*
 	 * With warm-up of previous tests, 10 runs, time in milliseconds
 	 * 'hg status -A': Native client total 953 (95 per run), Java client 94 (9)