Skip to content

Commit

Permalink
test: write test FirstUniqueCharacter
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Nov 21, 2022
1 parent 21414d5 commit c57861a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/leetcode/FirstUniqueCharacterTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package leetcode;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class FirstUniqueCharacterTest {
@Test
void firstUniqCharTest() {
String s1 = "leetcode";
Assertions.assertEquals(0, FirstUniqueCharacter.firstUniqChar(s1));

String s2 = "loveleetcode";
Assertions.assertEquals(2, FirstUniqueCharacter.firstUniqChar(s2));

String s3 = "aabb";
Assertions.assertEquals(-1, FirstUniqueCharacter.firstUniqChar(s3));
}
}

0 comments on commit c57861a

Please sign in to comment.