18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 14:16:48 +01:00

test(editor): a mistyped track fails the self-test, indented comments are skipped, case 7b checks the switch got bent

- A blank line or an indented `#` comment in a script is no longer a command no group takes.
- `trackcant`, `routegauge` and `tracksetdelete` with a track that isn't there count as a failed expectation.
- `expect shaped <switch> <yes|no>`: 7b checks that the gizmo drag bent the switch out of its record before deleting it.
- The ramp-length loop of test_alignment counts in an integer (Sonar S2193).
This commit is contained in:
maj00r
2026-11-24 18:34:25 +01:00
parent fd5bdd7ce4
commit 65e4870318
7 changed files with 59 additions and 6 deletions
+8
View File
@@ -15,6 +15,7 @@ http://mozilla.org/MPL/2.0/.
#include "stdafx.h"
#include "application/editormode.h"
#include "application/editoruilayer.h"
#include "application/editormodeselftest.h"
#include "application/editormodeshared.h"
#include "editor/editorFormat.hpp"
#include "editor/editorGeometry.hpp"
@@ -2098,8 +2099,15 @@ editor_mode::selftest_result editor_mode::selftest_props(std::string const &Comm
// the set made of the tracks, also of one, and the last of them selected, as the set stays the selection only with it
m_track_set.clear();
for (std::string name; Words >> name;)
{
if (auto *track{simulation::Paths.find(name)}; track != nullptr && false == track->m_editorremoved)
{
m_track_set.push_back(track);
continue;
}
editor_selftest::fail();
WriteLog("SELFTEST FAIL tracksetdelete: no track " + name);
}
m_node = m_track_set.empty() ? nullptr : m_track_set.back();
m_track_point = {};
ui()->set_node(m_node);