9#include "testing/testing.h"
15 EXPECT_TRUE(std::holds_alternative<rna_path::Member>(item));
16 const auto &member = std::get<rna_path::Member>(item);
17 EXPECT_EQ(member.identifier.ref(), expected);
22 EXPECT_TRUE(std::holds_alternative<rna_path::LookupIndex>(item));
23 const auto &lookup_index = std::get<rna_path::LookupIndex>(item);
29 EXPECT_TRUE(std::holds_alternative<rna_path::LookupKey>(item));
30 const auto &lookup_key = std::get<rna_path::LookupKey>(item);
31 EXPECT_EQ(lookup_key.key.ref(), expected);
40TEST(parse_rna_path, just_member)
48TEST(parse_rna_path, just_index)
56TEST(parse_rna_path, just_key)
59 EXPECT_EQ(path->to_string(),
"[\"foo\"]");
67 "foo[42].bar.bar2[\"b\\\"az\"]");
68 EXPECT_EQ(path->to_string(),
"foo[42].bar.bar2[\"b\\\"az\"]");
83 "old_name",
"new_name", 1, 2,
false);
90 "old_name",
"new_name", 1, 2,
true);
97 "bone \"jaw\"",
"\"jaw\" bone", 1, 2,
true);
98 EXPECT_EQ(
"[\"bone \\\"jaw\\\"\"]", old_key);
99 EXPECT_EQ(
"[\"\\\"jaw\\\" bone\"]", new_key);
137 EXPECT_EQ(
"[\"\\\"quotes\\\"\"]", infix);
static std::optional< ParsedRNAPath > from_string(StringRefNull path)
#define EXPECT_FALSE(result)
#define EXPECT_TRUE(result)
std::variant< Member, LookupIndex, LookupKey > Item
TEST_F(BlfLoadTest, load)
static void expect_lookup_key_item(const rna_path::Item &item, const StringRef expected)
TEST(any_virtual, DefaultConstructor)
static void expect_lookup_index_item(const rna_path::Item &item, const int64_t expected)
static void expect_member_item(const rna_path::Item &item, const StringRef expected)
std::string RNA_path_number_to_infix(const int number)
std::string RNA_path_name_to_infix(const StringRefNull string)
std::pair< std::string, std::string > RNA_generate_keys_for_path_rename(const StringRefNull old_infix, const StringRefNull new_infix, const int old_subscript, const int new_subscript, const bool infix_is_name)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)