Fixed #29. Added support for shuffle function

This commit is contained in:
Shekhar Gulati
2016-05-22 16:55:55 +05:30
parent 95a0be5c7c
commit 0929da6512
2 changed files with 31 additions and 12 deletions
+11 -2
View File
@@ -6,12 +6,12 @@ import java.util.Arrays;
import java.util.Optional;
import static java.util.stream.Collectors.toList;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.collection.IsArrayContainingInOrder.arrayContaining;
import static org.hamcrest.collection.IsArrayWithSize.emptyArray;
import static org.junit.Assert.*;
import static strman.Strman.*;
import static strman.Strman.endsWith;
import static strman.Strman.format;
public class StrmanTest {
@@ -663,4 +663,13 @@ public class StrmanTest {
assertThat(htmlEncode("Ж"), equalTo("Ж"));
assertThat(htmlEncode("┐"), equalTo("┐"));
}
@Test
public void shuffle_shouldShuffleAString() throws Exception {
assertThat(shuffle("shekhar"), not(equalTo("shekhar")));
assertThat(shuffle("strman"), not(equalTo("strman")));
assertThat(shuffle(""), equalTo(""));
assertThat(shuffle("s"), equalTo("s"));
}
}