Lumiera  0.pre.03
»edit your freedom«
test-mutation-target.hpp File Reference

Go to the source code of this file.

Description

Diagnostic helper for unit tests regarding mutation of custom data.

The TreeMutator provides a specialised adapter to attach to a TestMutationTarget. This adapter is optional and can be combined with any other binding for arbitrary hierarchical data structures. It operates in the way of a "wire tap", where the observed "mutation primitives" are recorded within the TestMutationTarget, which offers query functions for the unit test to verify what happened.

Remarks
this facility was created during the attempt to shape the internal API of TreeMutator, including definition of the "mutation primitives"; it might be helpful later to diagnose problems with data mutation.
Todo:
WIP 2/2016
See also
TreeMutatorBinding_test
TreeMutator

Definition in file test-mutation-target.hpp.

#include "lib/error.hpp"
#include "lib/symbol.hpp"
#include "lib/diff/record.hpp"
#include "lib/diff/tree-mutator.hpp"
#include "lib/idi/genfunc.hpp"
#include "lib/format-string.hpp"
#include "lib/format-util.hpp"
#include "lib/test/event-log.hpp"
#include "lib/nocopy.hpp"
#include "lib/util.hpp"
#include <utility>
#include <string>
#include <vector>

Classes

class  TestMutationTarget
 Test adapter to watch and verify how the TreeMutator binds to custom tree data structures. More...
 
class  TestWireTap< PAR >
 

Macros

#define STRINGIFY_CONTENT(_TY_)   virtual void handle (_TY_& val) override { representation = util::toString (val); }
 

Functions

template<typename T >
string identify (const T *const entity)
 
string render (DataCap const &)
 
string renderAttribute (GenNode const &elm)
 
string renderChild (GenNode const &elm)
 
string renderNode (GenNode const &n)
 
string renderRecord (Rec const &record)
 

Namespaces

 lib
 Implementation namespace for support and library code.