mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-12 08:33:57 +00:00
Fixed #29. Added support for shuffle function
This commit is contained in:
@@ -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"));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user