-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[template] Arguments substititation, class arguments checking, arguments in params duplication #41
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add tests
- Update documentation, changelog
- Fix commit and branch naming style
… in params duplication
3bc4b24
to
952d33e
Compare
for (ScAddr const & argument : argumentList) // this block is executed if inputStructure is valid | ||
ScIterator5Ptr const & classesIterator = context->Iterator5( | ||
ScType::NodeConstClass, ScType::EdgeAccessVarPosPerm, var, ScType::EdgeAccessConstPosPerm, scTemplate); | ||
bool isBelong = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this var should be initialized with true. In that case replacements for variables without classes will be searched in arguments and not in input structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this test does not call TemplateManager::createTemplateParams
sc_node_class | ||
-> concept_human;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add sc_node_norole_relation for nrel_system_identifier and nrel_father
@template = [* | ||
_hum1 | ||
_=> nrel_father:: | ||
_hum2;; | ||
|
||
_hum3 | ||
_=> nrel_father:: | ||
_hum2;; | ||
|
||
concept_human | ||
_-> _hum1; | ||
_-> _hum3;; | ||
*];; | ||
@template | ||
=> nrel_system_identifier: [search_template];; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not
search_template = [* .... *];;
human_ivan_ivanov | ||
<- concept_human; | ||
=> nrel_father: | ||
human_andrey_ivanov;; | ||
|
||
human_pavel_ivanov | ||
<- concept_human; | ||
=> nrel_father: | ||
human_andrey_ivanov;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not andreevich?
concept_human | ||
_-> _hum1; | ||
_-> _hum3;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is human2 a person?
std::string firstHuman = "human_ivan_ivanov"; | ||
std::string secondHuman = "human_pavel_ivanov"; | ||
std::string varHumanName1 = "_hum1"; | ||
std::string varHumanName3 = "_hum3"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make const
loader.loadScsFile(context, TEST_FILES_DIR_PATH + "searchWithContentEqualResultTestStucture.scs"); | ||
initialize(); | ||
|
||
ScAddr searchTemplateAddr = context.HelperFindBySystemIdtf(TEST_SEARCH_TEMPLATE_ID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const &
for (ScAddr const & argument : argumentList) // this block is executed if inputStructure is valid | ||
ScIterator5Ptr const & classesIterator = context->Iterator5( | ||
ScType::NodeConstClass, ScType::EdgeAccessVarPosPerm, var, ScType::EdgeAccessConstPosPerm, scTemplate); | ||
bool isBelong = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is belong what? Name variables clear
@@ -103,6 +103,32 @@ TEST_F(TemplateSearchManagerTest, SearchWithContent_MultipleResultTestCase) | |||
searchResults[0][searchLinkIdentifier] == context.HelperFindBySystemIdtf(secondCorrectResultLinkIdentifier)); | |||
} | |||
|
|||
TEST_F(TemplateSearchManagerTest, SearchWithContent_EqualResultTestCase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no content in this template. Rename test and scs file for it
Fixes: