Skip to content

Commit bfa0b93

Browse files
committed
fixes for e2e test
1 parent 671b092 commit bfa0b93

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

renamify-core/src/coercion.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,13 @@ pub fn apply_coercion(
611611

612612
// Special case: if container is flat (no separators) but replacement has separators,
613613
// prefer the replacement's style over the container's flat style
614-
// This handles filenames like "renamify.svg" → "awesome_file_renaming_tool.svg"
614+
// This handles filenames like "old_tool.svg" → "new_tool.svg"
615615
let replacement_style = detect_style(new_pattern);
616616
let target_style = if matches!(container_style, Style::LowerFlat | Style::UpperFlat)
617-
&& !matches!(replacement_style, Style::LowerFlat | Style::UpperFlat | Style::Mixed | Style::Dot)
618-
{
617+
&& !matches!(
618+
replacement_style,
619+
Style::LowerFlat | Style::UpperFlat | Style::Mixed | Style::Dot
620+
) {
619621
replacement_style
620622
} else if pattern_style == Style::Pascal
621623
&& matches!(container_style, Style::Camel | Style::Pascal)

scripts/e2e-test.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,14 @@ DEBUG_AFRT="$CARGO_TARGET_DIR/debug/awesome_file_renaming_tool"
112112
echo "=== Running tests with new name ==="
113113
cargo test
114114

115-
echo "=== Running $DEBUG_AFRT init to add .awesome_file_renaming_tool/ to .gitignore"
116-
"$DEBUG_AFRT" init
117-
115+
# .renamify/ should have already been renamed in the .gitignore
118116
if ! rg .awesome_file_renaming_tool/ .gitignore; then
119117
echo "ERROR: Did not find .awesome_file_renaming_tool/ in .gitignore!"
120118
cat .gitignore
121119
exit 1
122120
fi
123121
echo "✓ Found .awesome_file_renaming_tool/ in .gitignore"
124122

125-
echo "=== Committing change to .gitignore"
126-
# Set git user config if not already set
127-
if ! git config user.email > /dev/null 2>&1; then
128-
git config --global user.email "e2e.test@example.com"
129-
fi
130-
if ! git config user.name > /dev/null 2>&1; then
131-
git config --global user.name "renamify e2e test"
132-
fi
133-
git add .gitignore
134-
git commit -m "Added .awesome_file_renaming_tool/ to .gitignore"
135-
136123
echo "=== Testing awesome_file_renaming_tool rename back to renamify ==="
137124
# Use awesome_file_renaming_tool to rename itself back
138125
"$DEBUG_AFRT" rename awesome_file_renaming_tool renamify --preview summary --yes
@@ -161,5 +148,8 @@ REL_RENAMIFY="$CARGO_TARGET_DIR/release/renamify"
161148

162149
"$REL_RENAMIFY" --version
163150

151+
# Remove left-over artifacts (history dirs for awesome_file_renaming_tool)
152+
rm -rf .awesome_file_renaming_tool renamify-core/.awesome_file_renaming_tool
153+
164154
ensure_working_directory_is_clean "after round-trip"
165155
echo "✓ Working directory is clean - round-trip successful!"

0 commit comments

Comments
 (0)