We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff9573a commit 193a8d7Copy full SHA for 193a8d7
src/main/java/com/thealgorithms/strings/StringRotationTest.java
@@ -0,0 +1,28 @@
1
+package com.thealgorithms.strings;
2
+
3
+import static org.junit.jupiter.api.Assertions.*;
4
+import org.junit.jupiter.api.Test;
5
6
+public class StringRotationTest {
7
8
+ @Test
9
+ void testValidRotation() {
10
+ assertTrue(StringRotation.isRotation("waterbottle", "erbottlewat"));
11
+ }
12
13
14
+ void testInvalidRotation() {
15
+ assertFalse(StringRotation.isRotation("hello", "world"));
16
17
18
19
+ void testDifferentLengths() {
20
+ assertFalse(StringRotation.isRotation("abc", "abcd"));
21
22
23
24
+ void testNullInput() {
25
+ assertFalse(StringRotation.isRotation(null, "abc"));
26
+ assertFalse(StringRotation.isRotation("abc", null));
27
28
+}
0 commit comments