chore: sync workspace state

This commit is contained in:
2026-03-29 01:36:53 +08:00
parent eb5de3e3d4
commit e5cb79f3ce
4935 changed files with 35593 additions and 360696 deletions

View File

@@ -329,10 +329,7 @@ TEST_F(EditorActionRoutingTest, ProjectCommandsCreateFolderMoveAssetAndOpenFolde
std::ofstream(sourceFilePath.string()) << "move source";
EXPECT_TRUE(Commands::CreateFolder(m_context.GetProjectManager(), "MovedFolder"));
m_context.GetProjectManager().RefreshCurrentFolder();
const AssetItemPtr folderItem = FindCurrentItemByName("MovedFolder");
const AssetItemPtr folderItem = Commands::CreateFolder(m_context.GetProjectManager(), "MovedFolder");
ASSERT_NE(folderItem, nullptr);
ASSERT_TRUE(folderItem->isFolder);
@@ -344,6 +341,36 @@ TEST_F(EditorActionRoutingTest, ProjectCommandsCreateFolderMoveAssetAndOpenFolde
EXPECT_EQ(m_context.GetProjectManager().GetCurrentPath(), "Assets/MovedFolder");
}
TEST_F(EditorActionRoutingTest, ProjectCommandsCreateFolderUsesUniqueDefaultName) {
const AssetItemPtr firstFolder = Commands::CreateFolder(m_context.GetProjectManager(), "New Folder");
const AssetItemPtr secondFolder = Commands::CreateFolder(m_context.GetProjectManager(), "New Folder");
ASSERT_NE(firstFolder, nullptr);
ASSERT_NE(secondFolder, nullptr);
EXPECT_NE(firstFolder->fullPath, secondFolder->fullPath);
EXPECT_TRUE(fs::exists(m_projectRoot / "Assets" / "New Folder"));
EXPECT_TRUE(fs::exists(m_projectRoot / "Assets" / "New Folder 1"));
}
TEST_F(EditorActionRoutingTest, ProjectCommandsRenameAssetUpdatesSelectionAndPreservesFileExtension) {
const fs::path assetsDir = m_projectRoot / "Assets";
const fs::path originalPath = assetsDir / "RenameMe.txt";
std::ofstream(originalPath.string()) << "rename target";
m_context.GetProjectManager().RefreshCurrentFolder();
const AssetItemPtr item = FindCurrentItemByName("RenameMe.txt");
ASSERT_NE(item, nullptr);
m_context.GetProjectManager().SetSelectedItem(item);
EXPECT_TRUE(Commands::RenameAsset(m_context.GetProjectManager(), item, "RenamedAsset"));
EXPECT_FALSE(fs::exists(originalPath));
EXPECT_TRUE(fs::exists(assetsDir / "RenamedAsset.txt"));
const AssetItemPtr renamedItem = FindCurrentItemByName("RenamedAsset.txt");
ASSERT_NE(renamedItem, nullptr);
EXPECT_EQ(m_context.GetProjectManager().GetSelectedItemPath(), renamedItem->fullPath);
}
TEST_F(EditorActionRoutingTest, ProjectItemContextRequestSelectsAssetAndStoresPopupTarget) {
const fs::path assetsDir = m_projectRoot / "Assets";
const fs::path filePath = assetsDir / "ContextAsset.txt";