mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-03 11:15:23 +01:00
test(editor): the station track picked by bands of height in a unit case; a station failing half way and one at the history cap in self-tests
The review of #508 asked for these two. - The choice of the track a station starts or ends on is trace_station::pick_station_track(), a free function of editor/editorTraceStation: the tracks in reach in plan compared by bands of 3 m of height, then by the distance in plan, the first of two alike. editor_mode::station_track_at() collects the tracks as before and takes its pick, in the same order and with the same comparisons, so it picks what it picked. The unit case covers a flyover above and a bridge over a cutting against the track at the height clicked, a high embankment within one band, a track only far above or below, the reach and the width of the bands. - st_5_station_failed: the station of st_1 made to fail after its first turnout, then after both turnouts with the line between them not laid. Each time the turnouts laid are taken back, the main track is as it was, the clicks are kept but the last one, the reason is told and Ctrl+Y has nothing to lay; the last click again lays the station in full. - st_6_station_history_cap: the same station laid with the history capped at 2 steps, laid in full and not taken for failed. - For them the self-test has stationfail <end|line> (the next station made to fail there, once; lay_station() asks selftest_station_fails(), which only the self-test sets), historycap <steps> and expect laypoints <count>.
This commit is contained in:
@@ -877,6 +877,14 @@ editor_mode::selftest_result editor_mode::selftest_expect(std::string const &com
|
||||
if (false == malformed(what, words))
|
||||
expectation(m_lay.tabs == tabs && m_lay.enters == enters, what, format("%d Tab, %d Enter", m_lay.tabs, m_lay.enters), format("%d Tab, %d Enter", tabs, enters));
|
||||
}
|
||||
else if (kind == "laypoints")
|
||||
{
|
||||
// the points of the lay tool clicked and not laid yet
|
||||
std::size_t wanted{0};
|
||||
words >> wanted;
|
||||
if (false == malformed(what, words))
|
||||
expectation(m_lay.points.size() == wanted, what, std::to_string(m_lay.points.size()), std::to_string(wanted));
|
||||
}
|
||||
else if (kind == "laycontinue")
|
||||
{
|
||||
int wanted{0};
|
||||
|
||||
Reference in New Issue
Block a user