diff options
author | George L. Albany <Megacake1234@gmail.com> | 2024-07-05 22:30:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 22:30:32 +0200 |
commit | 4a49007492152037bc1e9636b024cc67700e9dae (patch) | |
tree | 457b7fbda6d4470465c05d59b0ca51ed30628640 /tests/src/v2script | |
parent | deed8ec0ae23651529a58125012c1b4aab015d02 (diff) | |
parent | 3eb78b27505b602c1ccfa952c4cc00f942ccb2b9 (diff) |
Merge pull request #50 from OpenVicProject/simplify-string-interning
Fix string interning pointer invalidity for AST
Diffstat (limited to 'tests/src/v2script')
-rw-r--r-- | tests/src/v2script/AbstractSyntaxTree.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/src/v2script/AbstractSyntaxTree.cpp b/tests/src/v2script/AbstractSyntaxTree.cpp index c06da08..ad9382f 100644 --- a/tests/src/v2script/AbstractSyntaxTree.cpp +++ b/tests/src/v2script/AbstractSyntaxTree.cpp @@ -1,5 +1,4 @@ #include <string_view> -#include <type_traits> #include <openvic-dataloader/NodeLocation.hpp> #include <openvic-dataloader/detail/SymbolIntern.hpp> @@ -69,13 +68,13 @@ TEST_CASE("V2Script Nodes", "[v2script-nodes]") { auto* id = ast.create_with_intern<IdentifierValue>("id"); CHECK_IF(id) { CHECK(id->kind() == NodeKind::IdentifierValue); - CHECK(id->value(ast.symbol_interner) == "id"sv); + CHECK(id->value().view() == "id"sv); } auto* str = ast.create_with_intern<StringValue>("str"); CHECK_IF(str) { CHECK(str->kind() == NodeKind::StringValue); - CHECK(str->value(ast.symbol_interner) == "str"sv); + CHECK(str->value().view() == "str"sv); } auto* list = ast.create<ListValue>(); @@ -162,7 +161,7 @@ TEST_CASE("V2Script Nodes Location", "[v2script-nodes-location]") { auto* id = ast.create_with_loc_and_intern<IdentifierValue>(NodeLocation::make_from(&fake_buffer[0], &fake_buffer[1]), "id"); CHECK_IF(id) { - CHECK(id->value(ast.symbol_interner) == "id"sv); + CHECK(id->value().view() == "id"sv); auto location = ast.location_of(id); CHECK_FALSE(location.is_synthesized()); |