Skip to content

Commit

Permalink
Fix ' not being a special char in polish_names
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRoniOne committed Jan 5, 2024
1 parent 46aaed8 commit f9757af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/polish_names.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct Style{T} end

Style(s::Symbol) = Style{s}()

const SPECIAL_CHARS = r"[\s\-\.\_\/\:\\\*\?\"\>\<\|]"
const SPECIAL_CHARS = r"[\s\-\.\_\/\:\\\*\?\"\'\>\<\|]"

"""
polish_names!(table::CleanTable; style::Symbol=:snake_case)
Expand Down
8 changes: 4 additions & 4 deletions test/test_polish_names.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ using DataFrames: DataFrame
" _aName with_loTsOfProblems",
" _aName with_loTsOfProblems",
" _aName with_loTsOfProblems_1",
" _aName with_loTsOfProblems_1_a/b",
" _aName with_loTsOfProblems_1_a/b'c",
];
style=:snake_case,
) == Vector{Symbol}([
:a_name_with_lo_ts_of_problems,
:a_name_with_lo_ts_of_problems_1,
:a_name_with_lo_ts_of_problems_1_1,
:a_name_with_lo_ts_of_problems_1_a_b,
:a_name_with_lo_ts_of_problems_1_a_b_c,
])

@test generate_polished_names(
Expand All @@ -48,15 +48,15 @@ using DataFrames: DataFrame
" _aName with_loTsOfProblems",
" _aName with_loTsOfProblems_1",
" _aNameABC with_loTsOfProblemsDEF",
" _aNameABC with_loTsOfProblemsDEF_a/b",
" _aNameABC with_loTsOfProblemsDEF_a/b'c",
];
style=:camelCase,
) == Vector{Symbol}([
:aNameWithLoTsOfProblems,
:aNameWithLoTsOfProblems_1,
:aNameWithLoTsOfProblems1,
:aNameABCWithLoTsOfProblemsDEF,
:aNameABCWithLoTsOfProblemsDEFAB,
:aNameABCWithLoTsOfProblemsDEFABC,
])

let err = nothing
Expand Down

0 comments on commit f9757af

Please sign in to comment.