Skip to content

Commit

Permalink
unit tests for camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
goffrie committed Feb 13, 2024
1 parent 8e79c46 commit 464592a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pb-jelly-gen/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ fn camelcase(underscored: &str) -> String {
})
.collect()
}
#[test]
fn test_camelcase() {
assert_eq!(camelcase("foo"), "Foo");
assert_eq!(camelcase("foo_bar"), "FooBar");
assert_eq!(camelcase("FOO_BAR"), "FooBar");
assert_eq!(camelcase("OHNO128"), "Ohno128");
}

struct RustType<'a> {
ctx: &'a Context<'a>,
proto_file: &'a FileDescriptorProto,
Expand Down

0 comments on commit 464592a

Please sign in to comment.