change lib::Record string representation to handle empty parts better
...no need to enclose empty sections when there are no attributes or no children. Makes test code way more readable. TestEventLog_test PASS as far as implemented
This commit is contained in:
parent
00abf9f1f9
commit
5874b1b4dc
3 changed files with 8 additions and 9 deletions
|
|
@ -731,11 +731,10 @@ namespace diff{
|
|||
using lib::transformIterator;
|
||||
|
||||
return "Rec("
|
||||
+ (TYPE_NIL==type_? "" : type_+"| ")
|
||||
+ join (transformIterator (this->attribs(), renderAttribute))
|
||||
+ " |{"
|
||||
+ join (this->scope())
|
||||
+ "})"
|
||||
+ (TYPE_NIL==type_? "" : type_)
|
||||
+ (isnil(this->attribs())? "" : "| "+join (transformIterator (this->attribs(), renderAttribute))+" ")
|
||||
+ (isnil(this->scope())? "" : "|{"+join (this->scope())+"}")
|
||||
+ ")"
|
||||
;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ END
|
|||
TEST "Generic Record data node" GenNodeBasic_test <<END
|
||||
out: GenNode.+_CHILD_Record.+Rec.spam..ham = DataCap.+eggs
|
||||
out-lit: --spam--
|
||||
out: GenNode.+"baked beans".+Rec.hasSpam = DataCap.«bool».+«char».+«std::string».*«double».+GenNode.+"spam".+«lib::diff::Record<lib::diff::GenNode>».+«std::string».eggs.+«std::string».spam.+«std::string».spam
|
||||
out: GenNode.+"baked beans".+Rec...hasSpam = DataCap.«bool».+«char».+«std::string».*«double».+GenNode.+"spam".+«lib::diff::Record<lib::diff::GenNode>».+«std::string».eggs.+«std::string».spam.+«std::string».spam
|
||||
out: GenNode.+"hasSpam".+«bool».1
|
||||
out: GenNode.+_CHILD_char.+«char».\*
|
||||
out: GenNode.+_CHILD_string.+«std::string».★
|
||||
|
|
|
|||
|
|
@ -87,9 +87,9 @@ namespace test{
|
|||
log.verify("α").before("β");
|
||||
VERIFY_ERROR (ASSERTION, log.verify("β").before("α"));
|
||||
|
||||
CHECK (join(log) == "Rec(EventLogHeader| ID = TestEventLog_test."+idi::instanceTypeID(this)+" |), "
|
||||
+ "Rec(event| |{α}), "
|
||||
+ "Rec(event| |{β})");
|
||||
CHECK (join(log) == "Rec(EventLogHeader| ID = "+idi::instanceTypeID(this)+" ), "
|
||||
+ "Rec(event|{α}), "
|
||||
+ "Rec(event|{β})");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue