Skip to content

Commit

Permalink
Merge into master from pull request #434:
Browse files Browse the repository at this point in the history
Major oversight in test and typo (#434)
  • Loading branch information
abat committed Oct 16, 2015
2 parents 0e761f7 + 2f620ff commit 6aa62c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static MacAddress of(@Nonnull final String macString) throws IllegalArgum
Preconditions.checkArgument(macString.length() == MAC_STRING_LENGTH,
FORMAT_ERROR + macString);
final char separator = macString.charAt(2);
Preconditions.checkArgument(separator == ':' || separator == '0',
Preconditions.checkArgument(separator == ':' || separator == '-',
FORMAT_ERROR + macString + " (invalid separator)");

int index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ public class MacAddressTest {
@Test
public void testOfString() {
testOfStringForArray(testColonStrings);
testOfStringForArray(testColonStrings);
testOfStringForArray(testHyphenStrings);
}

private void testOfStringForArray(String [] strings) {
for(int i=0; i < testAddresses.length; i++ ) {
MacAddress ip = MacAddress.of(strings[i]);
assertEquals(testInts[i], ip.getLong());
assertArrayEquals(testAddresses[i], ip.getBytes());
assertEquals(strings[i], ip.toString());
}
}

Expand Down

0 comments on commit 6aa62c3

Please sign in to comment.