refactor: re-place files into correct position according to namespace hierarchy

This commit is contained in:
2025-06-30 08:45:18 +08:00
parent e166dc41ac
commit 3030a67ca3
17 changed files with 50 additions and 50 deletions

View File

@ -1,10 +1,10 @@
#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/rust/parse.hpp>
#include <yycc/rust/num/parse.hpp>
#include <yycc/prelude/rust.hpp>
#define PARSE ::yycc::rust::parse
#define PARSE ::yycc::rust::num::parse
namespace yycctest::rust::parse {
@ -30,7 +30,7 @@ namespace yycctest::rust::parse {
EXPECT_FALSE(rv.has_value()); \
}
TEST(RustParse, Common) {
TEST(RustNumParse, Common) {
TEST_SUCCESS(i8, INT8_C(-61), "-61");
TEST_SUCCESS(u8, UINT8_C(200), "200");
TEST_SUCCESS(i16, INT16_C(6161), "6161");
@ -47,17 +47,17 @@ namespace yycctest::rust::parse {
TEST_SUCCESS(bool, false, "false");
}
TEST(RustParse, Radix) {
TEST(RustNumParse, Radix) {
TEST_SUCCESS(u32, UINT32_C(0xffff), "ffff", 16);
TEST_SUCCESS(u32, UINT32_C(032), "032", 8);
TEST_SUCCESS(u32, UINT32_C(0B1011), "1011", 2);
}
TEST(RustParse, CaseInsensitive) {
TEST(RustNumParse, CaseInsensitive) {
TEST_SUCCESS(bool, true, "tRUE");
}
TEST(RustParse, Overflow) {
TEST(RustNumParse, Overflow) {
TEST_FAIL(i8, "6161");
TEST_FAIL(u8, "32800");
TEST_FAIL(i16, "61616161");
@ -71,13 +71,13 @@ namespace yycctest::rust::parse {
TEST_FAIL(double, "1e114514");
}
TEST(RustParse, BadRadix) {
TEST(RustNumParse, BadRadix) {
TEST_FAIL(u32, "fghj", 16);
TEST_FAIL(u32, "099", 8);
TEST_FAIL(u32, "12345", 2);
}
TEST(RustParse, InvalidWords) {
TEST(RustNumParse, InvalidWords) {
TEST_FAIL(u32, "hello, world!");
TEST_FAIL(bool, "hello, world!");
}

View File

@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <yycc.hpp>
#include <yycc/rust/stringify.hpp>
#include <yycc/rust/num/stringify.hpp>
#include <yycc/prelude/rust.hpp>