18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 20:05:23 +01:00

fix(editor): a map opened on the model gets its project file also with nothing to migrate

open_project() writes no project file when there are no //$ lines to migrate (#461), but the editing on the model relies on
the map having its project file from the start: the self-test cases m_1_lay_managed and ps_2_setup_project failed with it
absent. session::open() writes it when it isn't there.
This commit is contained in:
maj00r
2026-11-24 20:11:01 +01:00
parent 14bbd392b2
commit e6f3c7e4e4
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -64,9 +64,9 @@ TEST_CASE("project session: the map opened gets its project, a command tried cha
project::session session;
auto const opened{session.open(folder.root(), "mapa.scn")};
REQUIRE(opened.done);
// nothing to migrate: no file yet, it's written as the scenery is saved
// nothing to migrate, and the map has its project file all the same: the session writes it as the map is opened
CHECK_FALSE(opened.migrated);
CHECK_FALSE(std::filesystem::exists(folder.root() / "mapa.eu07proj"));
CHECK(std::filesystem::exists(folder.root() / "mapa.eu07proj"));
CHECK(session.file() == folder.root() / "mapa.eu07proj");
CHECK(session.network().lines().empty());