refactor: continue refactor to make the project can be built

This commit is contained in:
2025-07-31 22:25:14 +08:00
parent 5372af79f8
commit ce2b411b0b
30 changed files with 791 additions and 943 deletions

View File

@ -1,35 +0,0 @@
#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/rust/num/parse.hpp>
#include <yycc/prelude/rust.hpp>
#define PARSE ::yycc::rust::num::parse
namespace yycctest::rust::num::parse {
// We only want to test it if C++ support it.
#if defined(YYCC_CPPFEAT_EXPECTED)
#define TEST_NS RustNumParse
#define TEST_SUCCESS(type_t, expected_value, string_value, ...) \
{ \
u8string cache_string(YYCC_U8(string_value)); \
auto rv = PARSE::parse<type_t>(cache_string, ##__VA_ARGS__); \
ASSERT_TRUE(rv.has_value()); \
EXPECT_EQ(rv.value(), expected_value); \
}
#define TEST_FAIL(type_t, string_value, ...) \
{ \
u8string cache_string(YYCC_U8(string_value)); \
auto rv = PARSE::parse<type_t>(cache_string, ##__VA_ARGS__); \
EXPECT_FALSE(rv.has_value()); \
}
#include "../../../shared/parse_template.hpp"
#endif
} // namespace yycctest::rust::parse

View File

@ -1,22 +0,0 @@
#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/rust/num/stringify.hpp>
#include <yycc/prelude/rust.hpp>
#define STRINGIFY ::yycc::rust::num::stringify
namespace yycctest::rust::num::stringify {
#define TEST_NS RustNumStringify
#define TEST_SUCCESS(type_t, value, string_value, ...) \
{ \
type_t cache = value; \
u8string ret = STRINGIFY::stringify<type_t>(cache, ##__VA_ARGS__); \
EXPECT_EQ(ret, YYCC_U8(string_value)); \
}
#include "../../../shared/stringify_template.hpp"
}