On 28/01/14 11:13, Edward Welbourne wrote:
>
> In tests/acceptance/10_files/09_insert_lines/021.cf:
>
> > +}
> > +
> > +#######################################################
> > +
> > +bundle agent init
> > +{
> > +  files:
> > +      "$(G.testfile).expected"
> > +      create => "true",
> > +      edit_line => init_expected,
> > +      edit_defaults => init_empty;
> > +
> > +  files:
> > +      "$(G.testfile).actual"
> > +      create => "true",
> > +      edit_line => init_file,
>
> Why can't we use init_expected here, making init_file (which is 
> identical to init_expected) redundant ?
> Would the reuse make the system skip the second attempt, making the 
> test vacuous ?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/cfengine/core/pull/1351/files#r9222337>.
>

Yes, you need a control sample to diff against for the test. So they 
start out as two identical copies and then we try to edit one and only 
one. If the test fails, the actual will change.


-- 
Founder and CTO at CFEngine
Author of In Search of Certainty: The Science of our Information 
Infrastructure <http://markburgess.org/certainty.html>