| 545 | // ═══════════════════════════════════════════════════ |
| 546 | |
| 547 | void testWorkspace_simpleTree() { |
| 548 | auto tree = makeSimpleTree(); |
| 549 | QStandardItemModel model; |
| 550 | buildWorkspaceModel(&model, tree, "TestProject.rcx"); |
| 551 | |
| 552 | // 1 top-level item (the project) |
| 553 | QCOMPARE(model.rowCount(), 1); |
| 554 | QStandardItem* project = model.item(0); |
| 555 | QCOMPARE(project->text(), QString("TestProject.rcx")); |
| 556 | |
| 557 | // Project has 1 child: the Player struct |
| 558 | QCOMPARE(project->rowCount(), 1); |
| 559 | QStandardItem* player = project->child(0); |
| 560 | QVERIFY(player->text().contains("Player")); |
| 561 | QVERIFY(player->text().contains("struct")); |
| 562 | |
| 563 | // Player struct has 2 children: health, speed |
| 564 | QCOMPARE(player->rowCount(), 2); |
| 565 | QVERIFY(player->child(0)->text().contains("health")); |
| 566 | QVERIFY(player->child(1)->text().contains("speed")); |
| 567 | } |
| 568 | |
| 569 | void testWorkspace_twoRootTree() { |
| 570 | auto tree = makeTwoRootTree(); |
nothing calls this directly
no test coverage detected