Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 21.3k
Expand file tree
/
Copy pathIsomorphicTest.java
More file actions
Latest commit
23 lines (18 loc) · 1021 Bytes
/
Copy pathIsomorphicTest.java
File metadata and controls
23 lines (18 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
packagecom.thealgorithms.strings;
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
importjava.util.stream.Stream;
importorg.junit.jupiter.params.ParameterizedTest;
importorg.junit.jupiter.params.provider.Arguments;
importorg.junit.jupiter.params.provider.MethodSource;
publicfinalclassIsomorphicTest {
@ParameterizedTest
@MethodSource("inputs")
publicvoidtestCheckStrings(Stringstr1, Stringstr2, Booleanexpected) {
assertEquals(expected, Isomorphic.areIsomorphic(str1, str2));
assertEquals(expected, Isomorphic.areIsomorphic(str2, str1));
}
privatestaticStream<Arguments> inputs() {
returnStream.of(Arguments.of("", "", Boolean.TRUE), Arguments.of("", "a", Boolean.FALSE), Arguments.of("aaa", "aa", Boolean.FALSE), Arguments.of("abbbbaac", "kffffkkd", Boolean.TRUE), Arguments.of("xyxyxy", "bnbnbn", Boolean.TRUE), Arguments.of("ghjknnmm", "wertpopo", Boolean.FALSE),
Arguments.of("aaammmnnn", "ggghhhbbj", Boolean.FALSE));
}
}