63 lines
2.5 KiB
C++
63 lines
2.5 KiB
C++
#pragma once
|
|
#include "test_framework.hpp"
|
|
|
|
namespace lsp::test
|
|
{
|
|
// Transformer 转换功能测试类
|
|
class TransformerTests
|
|
{
|
|
public:
|
|
static void registerTests(TestRunner& runner);
|
|
|
|
private:
|
|
// ==================== ToLSPAny 基本类型测试 ====================
|
|
static TestResult testToLSPAnyBoolean();
|
|
static TestResult testToLSPAnyInteger();
|
|
static TestResult testToLSPAnyUInteger();
|
|
static TestResult testToLSPAnyFloat();
|
|
static TestResult testToLSPAnyDouble();
|
|
static TestResult testToLSPAnyString();
|
|
static TestResult testToLSPAnyCString();
|
|
|
|
// ==================== ToLSPAny 容器类型测试 ====================
|
|
static TestResult testToLSPAnyVector();
|
|
static TestResult testToLSPAnyMap();
|
|
static TestResult testToLSPAnyOptionalValue();
|
|
static TestResult testToLSPAnyOptionalNullopt();
|
|
|
|
// ==================== ToLSPAny LSP类型测试 ====================
|
|
static TestResult testToLSPAnyLSPObject();
|
|
static TestResult testToLSPAnyLSPArray();
|
|
static TestResult testToLSPAnyLSPAny();
|
|
|
|
// ==================== FromLSPAny 基本类型测试 ====================
|
|
static TestResult testFromLSPAnyBoolean();
|
|
static TestResult testFromLSPAnyInteger();
|
|
static TestResult testFromLSPAnyString();
|
|
static TestResult testFromLSPAnyDouble();
|
|
|
|
// ==================== FromLSPAny 容器类型测试 ====================
|
|
static TestResult testFromLSPAnyVector();
|
|
static TestResult testFromLSPAnyOptionalValue();
|
|
static TestResult testFromLSPAnyOptionalNull();
|
|
static TestResult testFromLSPAnyLSPObject();
|
|
static TestResult testFromLSPAnyLSPArray();
|
|
|
|
// ==================== 数字类型转换测试 ====================
|
|
static TestResult testExtractNumberFromInteger();
|
|
static TestResult testExtractNumberFromUInteger();
|
|
static TestResult testExtractNumberFromDecimal();
|
|
static TestResult testExtractNumberCrossType();
|
|
|
|
// ==================== 错误处理测试 ====================
|
|
static TestResult testFromLSPAnyTypeMismatch();
|
|
static TestResult testFromLSPAnyInvalidNumber();
|
|
static TestResult testFromLSPAnyInvalidArray();
|
|
|
|
// ==================== 嵌套结构测试 ====================
|
|
static TestResult testNestedVector();
|
|
static TestResult testNestedLSPObject();
|
|
static TestResult testMixedTypeNesting();
|
|
};
|
|
}
|