|
| 1 | +import org.junit.Test; |
| 2 | +import org.junit.Ignore; |
| 3 | + |
| 4 | +import static org.assertj.core.api.Assertions.assertThat; |
| 5 | + |
| 6 | +public class IdentifierTest { |
| 7 | + |
| 8 | + @Test |
| 9 | + public void empty() { |
| 10 | + assertThat(Identifier.clean("")).isEmpty(); |
| 11 | + } |
| 12 | + |
| 13 | + @Ignore("Remove to run test") |
| 14 | + @Test |
| 15 | + public void single_letter() { |
| 16 | + assertThat(Identifier.clean("A")).isEqualTo("A"); |
| 17 | + } |
| 18 | + |
| 19 | + @Ignore("Remove to run test") |
| 20 | + @Test |
| 21 | + public void string() { |
| 22 | + assertThat(Identifier.clean("àḃç")).isEqualTo("àḃç"); |
| 23 | + } |
| 24 | + |
| 25 | + @Ignore("Remove to run test") |
| 26 | + @Test |
| 27 | + public void spaces() { |
| 28 | + assertThat(Identifier.clean("my Id")).isEqualTo("my___Id"); |
| 29 | + } |
| 30 | + |
| 31 | + @Ignore("Remove to run test") |
| 32 | + @Test |
| 33 | + public void leading_and_trailing_spaces() { |
| 34 | + assertThat(Identifier.clean(" myId ")).isEqualTo("_myId_"); |
| 35 | + } |
| 36 | + |
| 37 | + @Ignore("Remove to run test") |
| 38 | + @Test |
| 39 | + public void ctrl() { |
| 40 | + assertThat(Identifier.clean("my\0Id")).isEqualTo("myCTRLId"); |
| 41 | + } |
| 42 | + |
| 43 | + @Ignore("Remove to run test") |
| 44 | + @Test |
| 45 | + public void string_with_no_letters() { |
| 46 | + assertThat(Identifier.clean("\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00")).isEmpty(); |
| 47 | + } |
| 48 | + |
| 49 | + @Ignore("Remove to run test") |
| 50 | + @Test |
| 51 | + public void kebab_to_camel_case() { |
| 52 | + assertThat(Identifier.clean("à-ḃç")).isEqualTo("àḂç"); |
| 53 | + } |
| 54 | + |
| 55 | + @Ignore("Remove to run test") |
| 56 | + @Test |
| 57 | + public void omit_lower_case_greek_letters() { |
| 58 | + assertThat(Identifier.clean("MyΟβιεγτFinder")).isEqualTo("MyΟFinder"); |
| 59 | + } |
| 60 | + |
| 61 | + @Ignore("Remove to run test") |
| 62 | + @Test |
| 63 | + public void combine_conversions() { |
| 64 | + assertThat(Identifier.clean("9 -abcĐ\uD83D\uDE00ω\0")).isEqualTo("_AbcĐCTRL"); |
| 65 | + } |
| 66 | +} |
0 commit comments