test: Update tests

This commit is contained in:
Petr Mironychev
2026-06-11 15:38:12 +02:00
parent 231a6a0215
commit f499be278d
3 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
// Copyright (C) 2024-2026 Petr Mironychev
// SPDX-License-Identifier: GPL-3.0-or-later
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
#include <gtest/gtest.h>
#include <QString>
#include <AgentConfig.hpp>
#include <AgentLoader.hpp>
#include <JsonPromptTemplate.hpp>
using QodeAssist::Agents::AgentLoader;
using QodeAssist::Templates::JsonPromptTemplate;
TEST(BundledAgentsTest, AllBundledAgentsLoadResolveAndRender)
{
Q_INIT_RESOURCE(agents);
const AgentLoader::LoadResult result = AgentLoader::load(QStringLiteral(":/agents"), QString());
EXPECT_TRUE(result.errors.isEmpty())
<< "bundled agent load errors: "
<< result.errors.join(QStringLiteral("; ")).toStdString();
ASSERT_FALSE(result.configs.empty()) << "no bundled agents were loaded from :/agents";
for (const auto &cfg : result.configs) {
QString error;
const auto tmpl = JsonPromptTemplate::fromConfig(cfg, &error);
EXPECT_NE(tmpl, nullptr) << "bundled agent '" << cfg.name.toStdString()
<< "' body failed to render: " << error.toStdString();
}
}

View File

@@ -6,6 +6,7 @@ add_executable(QodeAssistTest
LLMSuggestionTest.cpp
JsonPromptTemplateTest.cpp
ResponseRouterTest.cpp
BundledAgentsTest.cpp
# LLMClientInterfaceTests.cpp
unittest_main.cpp
)