Open Save in the project folder and offer the last name with a number counted on

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Si
2026-09-26 20:24:10 +02:00
co-authored by Claude Opus 5.5
parent ac8b62208c
commit 8537a3cf0a
6 changed files with 68 additions and 2 deletions
+15
View File
@@ -1281,6 +1281,21 @@ int main() {
{
const auto dir = std::filesystem::temp_directory_path() / "effector_test_project";
std::filesystem::create_directories(dir);
{
const auto base = (dir / "city.png").string();
std::filesystem::remove(dir / "city-1.png");
std::filesystem::remove(dir / "city-2.png");
check(nextExportPath(base) == (dir / "city-1.png").string(),
"the next export after a plain name counts from 1");
check(nextExportPath((dir / "city-1.png").string()) == (dir / "city-2.png").string(),
"the next export counts on from the last number");
std::ofstream((dir / "city-1.png").string()) << "x";
check(nextExportPath(base) == (dir / "city-2.png").string(),
"the next export skips a name already on disk");
std::filesystem::remove(dir / "city-1.png");
check(nextExportPath((dir / "a-b.mp4").string()) == (dir / "a-b-1.mp4").string(),
"a dash before letters is not a count");
}
const auto source = dir / "source.png";
gradient(64, 48, 7).save(source.string());