Skip to content

Commit

Permalink
Add snake_case test
Browse files Browse the repository at this point in the history
  • Loading branch information
visr committed Dec 24, 2024
1 parent 4d6b649 commit 88f5ba3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/test/config_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@ end
end

@testitem "snake_case" begin
using Ribasim: NodeType
@test Ribasim.snake_case("CamelCase") == "camel_case"
@test Ribasim.snake_case("ABCdef") == "a_b_cdef"
@test Ribasim.snake_case("snake_case") == "snake_case"
@test Ribasim.snake_case(:CamelCase) == :camel_case
@test Ribasim.snake_case(:ABCdef) == :a_b_cdef
@test Ribasim.snake_case(:snake_case) == :snake_case
@test Ribasim.snake_case(:CamelCase) === :camel_case
@test Ribasim.snake_case(:ABCdef) === :a_b_cdef
@test Ribasim.snake_case(:snake_case) === :snake_case
@test Ribasim.snake_case(NodeType.PidControl) === :pid_control
for nt in instances(NodeType.T)
@test Ribasim.snake_case(nt) isa Symbol
end
end

@testitem "camel_case" begin
Expand Down

0 comments on commit 88f5ba3

Please sign in to comment.