mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-16 10:44:13 +02:00
Fix tst_qetcontainer on a Windows checkout (#1482)
specMatchesSchema() finds the schema in QETZ-FORMAT.md by looking for "```sql\n". A Windows checkout gives the file CRLF line endings, so the marker is never found and the test fails with "no schema in QETZ-FORMAT.md". Drop the carriage returns after reading the file. Checked by converting QETZ-FORMAT.md to CRLF: the test failed with the CI message before this change and passes after it; with LF it passes both ways. All 51 cases of tst_qetcontainer pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -440,7 +440,9 @@ private slots:
|
||||
// columns in the same order, same types; written without keys (format 4)
|
||||
void specMatchesSchema()
|
||||
{
|
||||
const QString spec = QString::fromUtf8(read(QStringLiteral(QET_FORMAT_SPEC)));
|
||||
// A Windows checkout may give the file CRLF line endings
|
||||
const QString spec = QString::fromUtf8(read(QStringLiteral(QET_FORMAT_SPEC)))
|
||||
.remove(QLatin1Char('\r'));
|
||||
const int from = spec.indexOf(QStringLiteral("```sql\n"));
|
||||
const int to = spec.indexOf(QStringLiteral("```"), from + 7);
|
||||
QVERIFY2(from >= 0 && to > from, "no schema in QETZ-FORMAT.md");
|
||||
|
||||
Reference in New Issue
Block a user