Skip to content

Commit 6830b2f

Browse files
move from chars to squeaky-clean slug (exercism#1901)
Co-authored-by: Eric Balawejder <eric.balawejder@protonmail.com>
1 parent 9bd9ff8 commit 6830b2f

11 files changed

Lines changed: 30 additions & 29 deletions

File tree

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"status": "wip"
6767
},
6868
{
69-
"slug": "chars",
69+
"slug": "squeaky-clean",
70+
"name": "Squeaky Clean",
7071
"uuid": "b18ad603-e50e-4358-bb3e-0942fefb9dba",
7172
"concepts": [
7273
"chars"
File renamed without changes.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
# Instructions
22

33
In this exercise you will implement a partial set of utility routines to help a developer
4-
clean up identifier names.
4+
clean up SqueakyClean names.
55

6-
In the 4 tasks you will gradually build up the routine `clean` A valid identifier comprises
6+
In the 4 tasks you will gradually build up the routine `clean` A valid SqueakyClean comprises
77
zero or more letters and underscores.
88

99
In all cases the input string is guaranteed to be non-null. Note that the `clean` method should treat an empty string as valid.
1010

1111
## 1. Replace any spaces encountered with underscores
1212

13-
Implement the (_static_) `Identifier.clean()` method to replace any spaces with underscores. This also applies to leading and trailing spaces.
13+
Implement the (_static_) `SqueakyClean.clean()` method to replace any spaces with underscores. This also applies to leading and trailing spaces.
1414

1515
```java
16-
Identifier.clean("my Id");
16+
SqueakyClean.clean("my Id");
1717
// => "my___Id"
1818
```
1919

2020
## 2. Replace control characters with the upper case string "CTRL"
2121

22-
Modify the (_static_) `Identifier.clean()` method to replace control characters with the upper case string `"CTRL"`.
22+
Modify the (_static_) `SqueakyClean.clean()` method to replace control characters with the upper case string `"CTRL"`.
2323

2424
```java
25-
Identifier.clean("my\0Id");
25+
SqueakyClean.clean("my\0Id");
2626
// => "myCTRLId",
2727
```
2828

2929
## 3. Convert kebab-case to camelCase
3030

31-
Modify the (_static_) `Identifier.clean()` method to convert kebab-case to camelCase.
31+
Modify the (_static_) `SqueakyClean.clean()` method to convert kebab-case to camelCase.
3232

3333
```java
34-
Identifier.Clean("à-ḃç");
34+
SqueakyClean.Clean("à-ḃç");
3535
// => "àḂç"
3636
```
3737

3838
## 4. Omit Greek lower case letters
3939

40-
Modify the (_static_) `Identifier.clean()` method to omit any Greek letters in the range 'α' to 'ω'.
40+
Modify the (_static_) `SqueakyClean.clean()` method to omit any Greek letters in the range 'α' to 'ω'.
4141

4242
```java
43-
Identifier.Clean("MyΟβιεγτFinder");
43+
SqueakyClean.Clean("MyΟβιεγτFinder");
4444
// => "MyΟFinder"
4545
```
File renamed without changes.

exercises/concept/chars/.meta/config.json renamed to exercises/concept/squeaky-clean/.meta/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
],
99
"files": {
1010
"solution": [
11-
"src/main/java/Identifier.java"
11+
"src/main/java/SqueakyClean.java"
1212
],
1313
"test": [
14-
"src/test/java/IdentifierTest.java"
14+
"src/test/java/SqueakyCleanTest.java"
1515
],
1616
"exemplar": [
17-
".meta/src/reference/java/Identifier.java"
17+
".meta/src/reference/java/SqueakyClean.java"
1818
]
1919
},
2020
"forked_from": [
File renamed without changes.

exercises/concept/chars/.meta/src/reference/java/Identifier.java renamed to exercises/concept/squeaky-clean/.meta/src/reference/java/SqueakyClean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Identifier {
1+
class SqueakyClean {
22
static String clean(String identifier) {
33
final StringBuilder cleanIdentifier = new StringBuilder();
44
for (int i = 0; i < identifier.length(); i++) {
File renamed without changes.

exercises/concept/chars/src/main/java/Identifier.java renamed to exercises/concept/squeaky-clean/src/main/java/SqueakyClean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
class Identifier {
1+
class SqueakyClean {
22
static String clean(String identifier) {
3-
throw new UnsupportedOperationException("Please implement the (static) Chars.clean() method");
3+
throw new UnsupportedOperationException("Please implement the (static) SqueakyClean.clean() method");
44
}
55
}

exercises/concept/chars/src/test/java/IdentifierTest.java renamed to exercises/concept/squeaky-clean/src/test/java/SqueakyCleanTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,64 @@
33

44
import static org.assertj.core.api.Assertions.assertThat;
55

6-
public class IdentifierTest {
6+
public class SqueakyCleanTest {
77

88
@Test
99
public void empty() {
10-
assertThat(Identifier.clean("")).isEmpty();
10+
assertThat(SqueakyClean.clean("")).isEmpty();
1111
}
1212

1313
@Ignore("Remove to run test")
1414
@Test
1515
public void single_letter() {
16-
assertThat(Identifier.clean("A")).isEqualTo("A");
16+
assertThat(SqueakyClean.clean("A")).isEqualTo("A");
1717
}
1818

1919
@Ignore("Remove to run test")
2020
@Test
2121
public void string() {
22-
assertThat(Identifier.clean("àḃç")).isEqualTo("àḃç");
22+
assertThat(SqueakyClean.clean("àḃç")).isEqualTo("àḃç");
2323
}
2424

2525
@Ignore("Remove to run test")
2626
@Test
2727
public void spaces() {
28-
assertThat(Identifier.clean("my Id")).isEqualTo("my___Id");
28+
assertThat(SqueakyClean.clean("my Id")).isEqualTo("my___Id");
2929
}
3030

3131
@Ignore("Remove to run test")
3232
@Test
3333
public void leading_and_trailing_spaces() {
34-
assertThat(Identifier.clean(" myId ")).isEqualTo("_myId_");
34+
assertThat(SqueakyClean.clean(" myId ")).isEqualTo("_myId_");
3535
}
3636

3737
@Ignore("Remove to run test")
3838
@Test
3939
public void ctrl() {
40-
assertThat(Identifier.clean("my\0Id")).isEqualTo("myCTRLId");
40+
assertThat(SqueakyClean.clean("my\0Id")).isEqualTo("myCTRLId");
4141
}
4242

4343
@Ignore("Remove to run test")
4444
@Test
4545
public void string_with_no_letters() {
46-
assertThat(Identifier.clean("\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00")).isEmpty();
46+
assertThat(SqueakyClean.clean("\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00")).isEmpty();
4747
}
4848

4949
@Ignore("Remove to run test")
5050
@Test
5151
public void kebab_to_camel_case() {
52-
assertThat(Identifier.clean("à-ḃç")).isEqualTo("àḂç");
52+
assertThat(SqueakyClean.clean("à-ḃç")).isEqualTo("àḂç");
5353
}
5454

5555
@Ignore("Remove to run test")
5656
@Test
5757
public void omit_lower_case_greek_letters() {
58-
assertThat(Identifier.clean("MyΟβιεγτFinder")).isEqualTo("MyΟFinder");
58+
assertThat(SqueakyClean.clean("MyΟβιεγτFinder")).isEqualTo("MyΟFinder");
5959
}
6060

6161
@Ignore("Remove to run test")
6262
@Test
6363
public void combine_conversions() {
64-
assertThat(Identifier.clean("9 -abcĐ\uD83D\uDE00ω\0")).isEqualTo("_AbcĐCTRL");
64+
assertThat(SqueakyClean.clean("9 -abcĐ\uD83D\uDE00ω\0")).isEqualTo("_AbcĐCTRL");
6565
}
6666
}

0 commit comments

Comments
 (0)