Skip to content

Commit

Permalink
another codewars solution
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmir17 committed Jun 8, 2024
1 parent cb16512 commit ab2d788
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions codewars_kata_training/examples/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,27 @@ mod array_diff_tests {
}
}

#[cfg(test)]
mod break_camelcase_tests {
fn solution(s: &str) -> String {
s.chars()
.map(|c| {
if c.is_uppercase() {
format!(" {}", c)
} else {
c.to_string()
}
})
.collect::<String>()
}

#[test]
fn test_solution() {
assert_eq!(solution("camelCasing"), "camel Casing");
assert_eq!(solution("camelCasingTest"), "camel Casing Test");
}
}

#[cfg(test)]
mod find_outlier_tests {

Expand Down

0 comments on commit ab2d788

Please sign in to comment.