Testet Leerzeichen am Anfang und Ende von CommandStrings
authorfelix <felix@a944a559-bf0e-0410-8ddc-85264b264b6c>
Thu, 17 May 2007 13:26:44 +0000 (13:26 +0000)
committerfelix <felix@a944a559-bf0e-0410-8ddc-85264b264b6c>
Thu, 17 May 2007 13:26:44 +0000 (13:26 +0000)
git-svn-id: https://www.internetallee.de/svn/bytewurf@27 a944a559-bf0e-0410-8ddc-85264b264b6c

projekte/netzschalter/test/de/bytewurf/projekte/netzschalter/CommandTest.java

index 8dcc005..017e7a2 100644 (file)
@@ -18,7 +18,11 @@ public class CommandTest extends TestCase {
                assertTrue(checkCommandWithException("Test"));
                assertFalse(checkCommandWithException("123"));
                assertTrue(checkCommandWithException("a b 1 3"));
+               assertFalse(checkCommandWithException("0xab "));
+               assertFalse(checkCommandWithException(" 0xab "));
+               assertFalse(checkCommandWithException(" 0xab"));
                assertFalse(checkCommandWithException("0xa,0x12"));
+               assertFalse(checkCommandWithException("0xab,0xff"));
                assertFalse(checkCommandWithException("0xa,  0x12"));
                assertFalse(checkCommandWithException("0xaaa,  0x12"));
        }
@@ -47,6 +51,10 @@ public class CommandTest extends TestCase {
                assertEquals(10, commandBytes[0]);
                assertEquals(20, commandBytes[1]);
                assertEquals(30, commandBytes[2]);
+               
+               command = new Command("0xff");
+               assertEquals(1, command.getCommandBytes().length);
+               assertEquals(-1, command.getCommandBytes()[0]);
        }
 
 }