diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-03-02 04:41:24 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-03-02 04:41:24 -0800 |
commit | a802f0cedc7b5580d746f46ae62fcf8074ae3c49 (patch) | |
tree | ab8f531d51374491f2998f63239dbb767b21e493 /html/050scenario.cc.html | |
parent | a1e4fa7194da184b74083362de537ece23a2f2f1 (diff) | |
download | mu-a802f0cedc7b5580d746f46ae62fcf8074ae3c49.tar.gz |
3749
Diffstat (limited to 'html/050scenario.cc.html')
-rw-r--r-- | html/050scenario.cc.html | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html index 94cfcdae..43a9bd49 100644 --- a/html/050scenario.cc.html +++ b/html/050scenario.cc.html @@ -102,7 +102,7 @@ if ('onhashchange' in window) { <span id="L37" class="LineNr"> 37 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L38" class="LineNr"> 38 </span> run [ <span id="L39" class="LineNr"> 39 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">13</span> -<span id="L40" class="LineNr"> 40 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [a b c] +<span id="L40" class="LineNr"> 40 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [a b c] <span id="L41" class="LineNr"> 41 </span> ] <span id="L42" class="LineNr"> 42 </span> memory-should-contain [ <span id="L43" class="LineNr"> 43 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">13</span> @@ -157,16 +157,16 @@ if ('onhashchange' in window) { <span id="L92" class="LineNr"> 92 </span> <a href='050scenario.cc.html#L57'>scenario</a> result<span class="Delimiter">;</span> <span id="L93" class="LineNr"> 93 </span> result<span class="Delimiter">.</span>name = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L94" class="LineNr"> 94 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>Scenario_names<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">))</span> -<span id="L95" class="LineNr"> 95 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"duplicate <a href='050scenario.cc.html#L57'>scenario</a> name: '"</span> << result<span class="Delimiter">.</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L95" class="LineNr"> 95 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"duplicate <a href='050scenario.cc.html#L57'>scenario</a> name: '"</span> << result<span class="Delimiter">.</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L96" class="LineNr"> 96 </span> Scenario_names<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>result<span class="Delimiter">.</span>name<span class="Delimiter">);</span> <span id="L97" class="LineNr"> 97 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>name<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L98" class="LineNr"> 98 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L99" class="LineNr"> 99 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete <a href='050scenario.cc.html#L57'>scenario</a> at <a href='003trace.cc.html#L195'>end</a> of file</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L99" class="LineNr"> 99 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"incomplete <a href='050scenario.cc.html#L57'>scenario</a> at <a href='003trace.cc.html#L193'>end</a> of file</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L100" class="LineNr">100 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L101" class="LineNr">101 </span> <span class="Delimiter">}</span> <span id="L102" class="LineNr">102 </span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L103" class="LineNr">103 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="Constant">'['</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L104" class="LineNr">104 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"Expected '[' after <a href='050scenario.cc.html#L57'>scenario</a> '"</span> << result<span class="Delimiter">.</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L104" class="LineNr">104 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"Expected '[' after <a href='050scenario.cc.html#L57'>scenario</a> '"</span> << result<span class="Delimiter">.</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L105" class="LineNr">105 </span> exit<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L106" class="LineNr">106 </span> <span class="Delimiter">}</span> <span id="L107" class="LineNr">107 </span> <span class="Comment">// scenarios are take special 'code' strings so we need to ignore brackets</span> @@ -174,13 +174,13 @@ if ('onhashchange' in window) { <span id="L109" class="LineNr">109 </span> result<span class="Delimiter">.</span>to_run = <a href='014literal_string.cc.html#L33'>slurp_quoted</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L110" class="LineNr">110 </span> <span class="Comment">// delete [] delimiters</span> <span id="L111" class="LineNr">111 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!starts_with<span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">,</span> <span class="Constant">"["</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L112" class="LineNr">112 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" should start with '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L112" class="LineNr">112 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" should start with '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L113" class="LineNr">113 </span> result<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L114" class="LineNr">114 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span> <span id="L116" class="LineNr">116 </span> result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>erase<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span id="L117" class="LineNr">117 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>at<span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">)</span>-<span class="Constant">1</span><span class="Delimiter">)</span> != <span class="Constant">']'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L118" class="LineNr">118 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" has an unbalanced '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L118" class="LineNr">118 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" has an unbalanced '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L119" class="LineNr">119 </span> result<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L120" class="LineNr">120 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L121" class="LineNr">121 </span> <span class="Delimiter">}</span> @@ -291,13 +291,13 @@ if ('onhashchange' in window) { <span id="L226" class="LineNr">226 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!trace_contains_errors<span class="Delimiter">())</span> <span id="L227" class="LineNr">227 </span> run<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>front<span class="Delimiter">());</span> <span id="L228" class="LineNr">228 </span> <span class="Comment">// End Mu Test Teardown</span> -<span id="L229" class="LineNr">229 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Hide_errors && <a href='003trace.cc.html#L190'>trace_contains_errors</a><span class="Delimiter">()</span> && !Scenario_testing_scenario<span class="Delimiter">)</span> +<span id="L229" class="LineNr">229 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Hide_errors && <a href='003trace.cc.html#L188'>trace_contains_errors</a><span class="Delimiter">()</span> && !Scenario_testing_scenario<span class="Delimiter">)</span> <span id="L230" class="LineNr">230 </span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L231" class="LineNr">231 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>not_already_inside_test && Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L232" class="LineNr">232 </span> <a href='000organization.cc.html#L138'>teardown</a><span class="Delimiter">();</span> <span id="L233" class="LineNr">233 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Save_trace<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L234" class="LineNr">234 </span> ofstream fout<span class="Delimiter">(</span><span class="Constant">"last_trace"</span><span class="Delimiter">);</span> -<span id="L235" class="LineNr">235 </span> fout << Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L153'>readable_contents</a><span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L235" class="LineNr">235 </span> fout << Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L151'>readable_contents</a><span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> <span id="L236" class="LineNr">236 </span> fout<span class="Delimiter">.</span>close<span class="Delimiter">();</span> <span id="L237" class="LineNr">237 </span> <span class="Delimiter">}</span> <span id="L238" class="LineNr">238 </span> <span class="Normal">delete</span> Trace_stream<span class="Delimiter">;</span> @@ -350,7 +350,7 @@ if ('onhashchange' in window) { <span id="L285" class="LineNr">285 </span> bind_special_scenario_names<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> <span id="L286" class="LineNr">286 </span> <a href='012transform.cc.html#L46'>transform_all</a><span class="Delimiter">();</span> <span id="L287" class="LineNr">287 </span> run<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> -<span id="L288" class="LineNr">288 </span> <a href='003trace.cc.html#L231'>CHECK_TRACE_DOESNT_CONTAIN_ERRORS</a><span class="Delimiter">();</span> +<span id="L288" class="LineNr">288 </span> <a href='003trace.cc.html#L229'>CHECK_TRACE_DOESNT_CONTAIN_ERRORS</a><span class="Delimiter">();</span> <span id="L289" class="LineNr">289 </span><span class="Delimiter">}</span> <span id="L290" class="LineNr">290 </span> <span id="L291" class="LineNr">291 </span><span class="Comment">//: Watch out for redefinitions of scenario routines. We should never ever be</span> @@ -467,7 +467,7 @@ if ('onhashchange' in window) { <span id="L402" class="LineNr">402 </span> string lhs = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L403" class="LineNr">403 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>lhs<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L404" class="LineNr">404 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L405" class="LineNr">405 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L405" class="LineNr">405 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L193'>end</a> of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L406" class="LineNr">406 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L407" class="LineNr">407 </span> <span class="Delimiter">}</span> <span id="L408" class="LineNr">408 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_integer<span class="Delimiter">(</span>lhs<span class="Delimiter">))</span> <span class="Delimiter">{</span> @@ -481,31 +481,31 @@ if ('onhashchange' in window) { <span id="L416" class="LineNr">416 </span> string rhs = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L417" class="LineNr">417 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>rhs<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L418" class="LineNr">418 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L193'>end</a> of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L420" class="LineNr">420 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L421" class="LineNr">421 </span> <span class="Delimiter">}</span> <span id="L422" class="LineNr">422 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_integer<span class="Delimiter">(</span>rhs<span class="Delimiter">)</span> && !is_noninteger<span class="Delimiter">(</span>rhs<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L423" class="LineNr">423 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span id="L424" class="LineNr">424 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L425" class="LineNr">425 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L425" class="LineNr">425 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L426" class="LineNr">426 </span> <span class="Normal">else</span> <span id="L427" class="LineNr">427 </span> <span class="Comment">// just testing scenario support</span> -<span id="L428" class="LineNr">428 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L428" class="LineNr">428 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span id="L429" class="LineNr">429 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L430" class="LineNr">430 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L431" class="LineNr">431 </span> <span class="Delimiter">}</span> <span id="L432" class="LineNr">432 </span> <span class="Normal">double</span> value = <a href='015literal_noninteger.cc.html#L26'>to_double</a><span class="Delimiter">(</span>rhs<span class="Delimiter">);</span> <span id="L433" class="LineNr">433 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>locations_checked<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> -<span id="L434" class="LineNr">434 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"duplicate expectation for location '"</span> << address << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> -<span id="L435" class="LineNr">435 </span> <a href='003trace.cc.html#L171'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L434" class="LineNr">434 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"duplicate expectation for location '"</span> << address << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L435" class="LineNr">435 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L436" class="LineNr">436 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">)</span> != value<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L437" class="LineNr">437 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L438" class="LineNr">438 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L439" class="LineNr">439 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L439" class="LineNr">439 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L440" class="LineNr">440 </span> <span class="Delimiter">}</span> <span id="L441" class="LineNr">441 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L442" class="LineNr">442 </span> <span class="Comment">// just testing scenario support</span> -<span id="L443" class="LineNr">443 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L443" class="LineNr">443 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L444" class="LineNr">444 </span> <span class="Delimiter">}</span> <span id="L445" class="LineNr">445 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L446" class="LineNr">446 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> @@ -522,7 +522,7 @@ if ('onhashchange' in window) { <span id="L457" class="LineNr">457 </span> string _assign = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L458" class="LineNr">458 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>_assign<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L459" class="LineNr">459 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L460" class="LineNr">460 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (2)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L460" class="LineNr">460 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L193'>end</a> of file (2)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L461" class="LineNr">461 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L462" class="LineNr">462 </span> <span class="Delimiter">}</span> <span id="L463" class="LineNr">463 </span> assert<span class="Delimiter">(</span>_assign == <span class="Constant">"<-"</span><span class="Delimiter">);</span> @@ -530,41 +530,41 @@ if ('onhashchange' in window) { <span id="L465" class="LineNr">465 </span> string literal = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L466" class="LineNr">466 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>literal<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L467" class="LineNr">467 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L468" class="LineNr">468 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (3)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L468" class="LineNr">468 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L193'>end</a> of file (3)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L469" class="LineNr">469 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L470" class="LineNr">470 </span> <span class="Delimiter">}</span> <span id="L471" class="LineNr">471 </span> <span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a> = x<span class="Delimiter">.</span>value<span class="Delimiter">;</span> <span id="L472" class="LineNr">472 </span> <span class="Comment">// exclude quoting brackets</span> <span id="L473" class="LineNr">473 </span> assert<span class="Delimiter">(</span>*literal<span class="Delimiter">.</span>begin<span class="Delimiter">()</span> == <span class="Constant">'['</span><span class="Delimiter">);</span> literal<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>literal<span class="Delimiter">.</span>begin<span class="Delimiter">());</span> -<span id="L474" class="LineNr">474 </span> assert<span class="Delimiter">(</span>*--literal<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">()</span> == <span class="Constant">']'</span><span class="Delimiter">);</span> literal<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>--literal<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">());</span> +<span id="L474" class="LineNr">474 </span> assert<span class="Delimiter">(</span>*--literal<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">()</span> == <span class="Constant">']'</span><span class="Delimiter">);</span> literal<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>--literal<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">());</span> <span id="L475" class="LineNr">475 </span> check_string<span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> literal<span class="Delimiter">);</span> <span id="L476" class="LineNr">476 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L477" class="LineNr">477 </span> <span class="Delimiter">}</span> <span id="L478" class="LineNr">478 </span> <span class="Comment">// End Scenario Type Special-cases</span> -<span id="L479" class="LineNr">479 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"don't know how to check memory for '"</span> << lhs << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L479" class="LineNr">479 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"don't know how to check memory for '"</span> << lhs << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L480" class="LineNr">480 </span><span class="Delimiter">}</span> <span id="L481" class="LineNr">481 </span> <span id="L482" class="LineNr">482 </span><span class="Normal">void</span> check_string<span class="Delimiter">(</span><span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <span class="Normal">const</span> string& literal<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L483" class="LineNr">483 </span> <a href='003trace.cc.html#L171'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking string length at "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L483" class="LineNr">483 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking string length at "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L484" class="LineNr">484 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">)</span> != <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L485" class="LineNr">485 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> -<span id="L486" class="LineNr">486 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="Constant">" ("</span> << <a href='038new_text.cc.html#L143'>read_mu_text</a><span class="Delimiter">(</span>address-<span class="Comment">/*</span><span class="Comment">fake refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> << <span class="Constant">")</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L486" class="LineNr">486 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="Constant">" ("</span> << <a href='038new_text.cc.html#L143'>read_mu_text</a><span class="Delimiter">(</span>address-<span class="Comment">/*</span><span class="Comment">fake refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> << <span class="Constant">")</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L487" class="LineNr">487 </span> <span class="Normal">else</span> -<span id="L488" class="LineNr">488 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L488" class="LineNr">488 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L489" class="LineNr">489 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L490" class="LineNr">490 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L491" class="LineNr">491 </span> <span class="Delimiter">}</span> <span id="L492" class="LineNr">492 </span> ++address<span class="Delimiter">;</span> <span class="Comment">// now skip length</span> <span id="L493" class="LineNr">493 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L494" class="LineNr">494 </span> <a href='003trace.cc.html#L171'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << address+i << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L494" class="LineNr">494 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << address+i << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L495" class="LineNr">495 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">)</span> != literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L496" class="LineNr">496 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L497" class="LineNr">497 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L498" class="LineNr">498 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">" ('"</span> << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">"')</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L498" class="LineNr">498 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">" ('"</span> << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">"')</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L499" class="LineNr">499 </span> <span class="Delimiter">}</span> <span id="L500" class="LineNr">500 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L501" class="LineNr">501 </span> <span class="Comment">// just testing scenario support</span> -<span id="L502" class="LineNr">502 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L502" class="LineNr">502 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L503" class="LineNr">503 </span> <span class="Delimiter">}</span> <span id="L504" class="LineNr">504 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L505" class="LineNr">505 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> @@ -647,7 +647,7 @@ if ('onhashchange' in window) { <span id="L582" class="LineNr">582 </span> <span class="Normal">a</span>: d <span id="L583" class="LineNr">583 </span> ] <span id="L584" class="LineNr">584 </span>] -<span id="L585" class="LineNr">585 </span><span class="traceContains">+error: missing [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> +<span id="L585" class="LineNr">585 </span><span class="traceContains">+error: missing [b] in <a href='003trace.cc.html#L169'>trace</a> with label 'a'</span> <span id="L586" class="LineNr">586 </span> <span id="L587" class="LineNr">587 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L588" class="LineNr">588 </span>TRACE_SHOULD_CONTAIN<span class="Delimiter">,</span> @@ -668,41 +668,41 @@ if ('onhashchange' in window) { <span id="L603" class="LineNr">603 </span><span class="Comment">// simplified version of check_trace_contents() that emits errors rather</span> <span id="L604" class="LineNr">604 </span><span class="Comment">// than just printing to stderr</span> <span id="L605" class="LineNr">605 </span><span class="Normal">void</span> check_trace<span class="Delimiter">(</span><span class="Normal">const</span> string& expected<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L606" class="LineNr">606 </span> Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L137'>newline</a><span class="Delimiter">();</span> +<span id="L606" class="LineNr">606 </span> Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L135'>newline</a><span class="Delimiter">();</span> <span id="L607" class="LineNr">607 </span> vector<trace_line> expected_lines = parse_trace<span class="Delimiter">(</span>expected<span class="Delimiter">);</span> <span id="L608" class="LineNr">608 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L609" class="LineNr">609 </span> <span class="Normal">int</span> curr_expected_line = <span class="Constant">0</span><span class="Delimiter">;</span> -<span id="L610" class="LineNr">610 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L610" class="LineNr">610 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L611" class="LineNr">611 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label != p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> -<span id="L612" class="LineNr">612 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents != <a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span>contents<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L612" class="LineNr">612 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents != <a href='003trace.cc.html#L363'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span>contents<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L613" class="LineNr">613 </span> <span class="Comment">// match</span> <span id="L614" class="LineNr">614 </span> ++curr_expected_line<span class="Delimiter">;</span> <span id="L615" class="LineNr">615 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>curr_expected_line == <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L616" class="LineNr">616 </span> <span class="Delimiter">}</span> <span id="L617" class="LineNr">617 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> -<span id="L618" class="LineNr">618 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> -<span id="L619" class="LineNr">619 </span> << <span class="Constant">"in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L618" class="LineNr">618 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> +<span id="L619" class="LineNr">619 </span> << <span class="Constant">"in <a href='003trace.cc.html#L169'>trace</a> with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L620" class="LineNr">620 </span> <span class="Normal">else</span> -<span id="L621" class="LineNr">621 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> -<span id="L622" class="LineNr">622 </span> << <span class="Constant">"in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L621" class="LineNr">621 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> +<span id="L622" class="LineNr">622 </span> << <span class="Constant">"in <a href='003trace.cc.html#L169'>trace</a> with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L623" class="LineNr">623 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Hide_errors<span class="Delimiter">)</span> -<span id="L624" class="LineNr">624 </span> <a href='003trace.cc.html#L175'>DUMP</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label<span class="Delimiter">);</span> +<span id="L624" class="LineNr">624 </span> <a href='003trace.cc.html#L173'>DUMP</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label<span class="Delimiter">);</span> <span id="L625" class="LineNr">625 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L626" class="LineNr">626 </span><span class="Delimiter">}</span> <span id="L627" class="LineNr">627 </span> <span id="L628" class="LineNr">628 </span>vector<trace_line> parse_trace<span class="Delimiter">(</span><span class="Normal">const</span> string& expected<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L629" class="LineNr">629 </span> vector<string> buf = <a href='003trace.cc.html#L341'>split</a><span class="Delimiter">(</span>expected<span class="Delimiter">,</span> <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> +<span id="L629" class="LineNr">629 </span> vector<string> buf = <a href='003trace.cc.html#L339'>split</a><span class="Delimiter">(</span>expected<span class="Delimiter">,</span> <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> <span id="L630" class="LineNr">630 </span> vector<trace_line> result<span class="Delimiter">;</span> <span id="L631" class="LineNr">631 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>buf<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L632" class="LineNr">632 </span> buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> = <a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> +<span id="L632" class="LineNr">632 </span> buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> = <a href='003trace.cc.html#L363'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> <span id="L633" class="LineNr">633 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>empty<span class="Delimiter">())</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L634" class="LineNr">634 </span> <span class="Normal">int</span> delim = buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>find<span class="Delimiter">(</span><span class="Constant">": "</span><span class="Delimiter">);</span> <span id="L635" class="LineNr">635 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>delim == -<span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L636" class="LineNr">636 </span> <a href='003trace.cc.html#L178'>raise</a> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": lines in 'trace-should-contain' should be of the form <label>: <contents>. Both parts are required.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L636" class="LineNr">636 </span> <a href='003trace.cc.html#L176'>raise</a> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": lines in 'trace-should-contain' should be of the form <label>: <contents>. Both parts are required.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L637" class="LineNr">637 </span> result<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L638" class="LineNr">638 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L639" class="LineNr">639 </span> <span class="Delimiter">}</span> -<span id="L640" class="LineNr">640 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>trace_line<span class="Delimiter">(</span><a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> delim<span class="Delimiter">)),</span> <a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span>delim+<span class="Constant">2</span><span class="Delimiter">))));</span> +<span id="L640" class="LineNr">640 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>trace_line<span class="Delimiter">(</span><a href='003trace.cc.html#L363'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> delim<span class="Delimiter">)),</span> <a href='003trace.cc.html#L363'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span>delim+<span class="Constant">2</span><span class="Delimiter">))));</span> <span id="L641" class="LineNr">641 </span> <span class="Delimiter">}</span> <span id="L642" class="LineNr">642 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L643" class="LineNr">643 </span><span class="Delimiter">}</span> @@ -712,26 +712,26 @@ if ('onhashchange' in window) { <span id="L647" class="LineNr">647 </span><span class="Special">% Hide_errors = true;</span> <span id="L648" class="LineNr">648 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L649" class="LineNr">649 </span> run [ -<span id="L650" class="LineNr">650 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] +<span id="L650" class="LineNr">650 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] <span id="L651" class="LineNr">651 </span> ] <span id="L652" class="LineNr">652 </span> trace-should-contain [ <span id="L653" class="LineNr">653 </span> <span class="Normal">a</span>: b <span id="L654" class="LineNr">654 </span> <span class="Normal">a</span>: d <span id="L655" class="LineNr">655 </span> ] <span id="L656" class="LineNr">656 </span>] -<span id="L657" class="LineNr">657 </span><span class="traceContains">+error: missing [d] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> +<span id="L657" class="LineNr">657 </span><span class="traceContains">+error: missing [d] in <a href='003trace.cc.html#L169'>trace</a> with label 'a'</span> <span id="L658" class="LineNr">658 </span> <span id="L659" class="LineNr">659 </span><span class="Delimiter">:(scenario trace_check_passes_silently)</span> <span id="L660" class="LineNr">660 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L661" class="LineNr">661 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L662" class="LineNr">662 </span> run [ -<span id="L663" class="LineNr">663 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] +<span id="L663" class="LineNr">663 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] <span id="L664" class="LineNr">664 </span> ] <span id="L665" class="LineNr">665 </span> trace-should-contain [ <span id="L666" class="LineNr">666 </span> <span class="Normal">a</span>: b <span id="L667" class="LineNr">667 </span> ] <span id="L668" class="LineNr">668 </span>] -<span id="L669" class="LineNr">669 </span><span class="traceAbsent">-error: missing [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> +<span id="L669" class="LineNr">669 </span><span class="traceAbsent">-error: missing [b] in <a href='003trace.cc.html#L169'>trace</a> with label 'a'</span> <span id="L670" class="LineNr">670 </span>$error: <span class="Constant">0</span> <span id="L671" class="LineNr">671 </span> <span id="L672" class="LineNr">672 </span><span class="Comment">//: 'trace-should-not-contain' is like the '-' lines in our scenarios so far</span> @@ -743,13 +743,13 @@ if ('onhashchange' in window) { <span id="L678" class="LineNr">678 </span><span class="Special">% Hide_errors = true;</span> <span id="L679" class="LineNr">679 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L680" class="LineNr">680 </span> run [ -<span id="L681" class="LineNr">681 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] +<span id="L681" class="LineNr">681 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] <span id="L682" class="LineNr">682 </span> ] <span id="L683" class="LineNr">683 </span> trace-should-<span class="Normal">not</span>-contain [ <span id="L684" class="LineNr">684 </span> <span class="Normal">a</span>: b <span id="L685" class="LineNr">685 </span> ] <span id="L686" class="LineNr">686 </span>] -<span id="L687" class="LineNr">687 </span><span class="traceContains">+error: unexpected [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> +<span id="L687" class="LineNr">687 </span><span class="traceContains">+error: unexpected [b] in <a href='003trace.cc.html#L169'>trace</a> with label 'a'</span> <span id="L688" class="LineNr">688 </span> <span id="L689" class="LineNr">689 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L690" class="LineNr">690 </span>TRACE_SHOULD_NOT_CONTAIN<span class="Delimiter">,</span> @@ -770,11 +770,11 @@ if ('onhashchange' in window) { <span id="L705" class="LineNr">705 </span><span class="Comment">// simplified version of check_trace_contents() that emits errors rather</span> <span id="L706" class="LineNr">706 </span><span class="Comment">// than just printing to stderr</span> <span id="L707" class="LineNr">707 </span><span class="Normal">bool</span> check_trace_missing<span class="Delimiter">(</span><span class="Normal">const</span> string& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L708" class="LineNr">708 </span> Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L137'>newline</a><span class="Delimiter">();</span> +<span id="L708" class="LineNr">708 </span> Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L135'>newline</a><span class="Delimiter">();</span> <span id="L709" class="LineNr">709 </span> vector<trace_line> lines = parse_trace<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L710" class="LineNr">710 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>lines<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L711" class="LineNr">711 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>trace_count<span class="Delimiter">(</span>lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>label<span class="Delimiter">,</span> lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>contents<span class="Delimiter">)</span> != <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L712" class="LineNr">712 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"unexpected ["</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>contents << <span class="Constant">"] in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L712" class="LineNr">712 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"unexpected ["</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>contents << <span class="Constant">"] in <a href='003trace.cc.html#L169'>trace</a> with label '"</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L713" class="LineNr">713 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L714" class="LineNr">714 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L715" class="LineNr">715 </span> <span class="Delimiter">}</span> @@ -789,7 +789,7 @@ if ('onhashchange' in window) { <span id="L724" class="LineNr">724 </span> <span class="Normal">a</span>: b <span id="L725" class="LineNr">725 </span> ] <span id="L726" class="LineNr">726 </span>] -<span id="L727" class="LineNr">727 </span><span class="traceAbsent">-error: unexpected [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> +<span id="L727" class="LineNr">727 </span><span class="traceAbsent">-error: unexpected [b] in <a href='003trace.cc.html#L169'>trace</a> with label 'a'</span> <span id="L728" class="LineNr">728 </span>$error: <span class="Constant">0</span> <span id="L729" class="LineNr">729 </span> <span id="L730" class="LineNr">730 </span><span class="Delimiter">:(scenario trace_negative_check_fails_on_any_unexpected_line)</span> @@ -797,19 +797,19 @@ if ('onhashchange' in window) { <span id="L732" class="LineNr">732 </span><span class="Special">% Hide_errors = true;</span> <span id="L733" class="LineNr">733 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L734" class="LineNr">734 </span> run [ -<span id="L735" class="LineNr">735 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [d] +<span id="L735" class="LineNr">735 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [d] <span id="L736" class="LineNr">736 </span> ] <span id="L737" class="LineNr">737 </span> trace-should-<span class="Normal">not</span>-contain [ <span id="L738" class="LineNr">738 </span> <span class="Normal">a</span>: b <span id="L739" class="LineNr">739 </span> <span class="Normal">a</span>: d <span id="L740" class="LineNr">740 </span> ] <span id="L741" class="LineNr">741 </span>] -<span id="L742" class="LineNr">742 </span><span class="traceContains">+error: unexpected [d] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> +<span id="L742" class="LineNr">742 </span><span class="traceContains">+error: unexpected [d] in <a href='003trace.cc.html#L169'>trace</a> with label 'a'</span> <span id="L743" class="LineNr">743 </span> <span id="L744" class="LineNr">744 </span><span class="Delimiter">:(scenario trace_count_check)</span> <span id="L745" class="LineNr">745 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L746" class="LineNr">746 </span> run [ -<span id="L747" class="LineNr">747 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] +<span id="L747" class="LineNr">747 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] <span id="L748" class="LineNr">748 </span> ] <span id="L749" class="LineNr">749 </span> check-trace-count-<span class="Normal">for</span>-label <span class="Constant">1</span><span class="Delimiter">,</span> [a] <span id="L750" class="LineNr">750 </span>] @@ -822,15 +822,15 @@ if ('onhashchange' in window) { <span id="L757" class="LineNr">757 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L758" class="LineNr">758 </span><span class="Normal">case</span> CHECK_TRACE_COUNT_FOR_LABEL: <span class="Delimiter">{</span> <span id="L759" class="LineNr">759 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L760" class="LineNr">760 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'check-trace-count-for-label' requires exactly two ingredients, but got '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L760" class="LineNr">760 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'check-trace-count-for-label' requires exactly two ingredients, but got '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L761" class="LineNr">761 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L762" class="LineNr">762 </span> <span class="Delimiter">}</span> <span id="L763" class="LineNr">763 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_number<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> -<span id="L764" class="LineNr">764 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"first ingredient of 'check-trace-count-for-label' should be a number (count), but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L764" class="LineNr">764 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"first ingredient of 'check-trace-count-for-label' should be a number (count), but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L765" class="LineNr">765 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L766" class="LineNr">766 </span> <span class="Delimiter">}</span> <span id="L767" class="LineNr">767 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_literal_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> -<span id="L768" class="LineNr">768 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L768" class="LineNr">768 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L769" class="LineNr">769 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L770" class="LineNr">770 </span> <span class="Delimiter">}</span> <span id="L771" class="LineNr">771 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -844,12 +844,12 @@ if ('onhashchange' in window) { <span id="L779" class="LineNr">779 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>count != expected_count<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L780" class="LineNr">780 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L781" class="LineNr">781 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L782" class="LineNr">782 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": "</span> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << label << <span class="Constant">"' in <a href='003trace.cc.html#L171'>trace</a>: "</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> -<span id="L783" class="LineNr">783 </span> <a href='003trace.cc.html#L175'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span> +<span id="L782" class="LineNr">782 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": "</span> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in <a href='003trace.cc.html#L169'>trace</a> with label '"</span> << label << <span class="Constant">"' in <a href='003trace.cc.html#L169'>trace</a>: "</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L783" class="LineNr">783 </span> <a href='003trace.cc.html#L173'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span> <span id="L784" class="LineNr">784 </span> <span class="Delimiter">}</span> <span id="L785" class="LineNr">785 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L786" class="LineNr">786 </span> <span class="Comment">// just testing scenario support</span> -<span id="L787" class="LineNr">787 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << label << <span class="Constant">"' in <a href='003trace.cc.html#L171'>trace</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L787" class="LineNr">787 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in <a href='003trace.cc.html#L169'>trace</a> with label '"</span> << label << <span class="Constant">"' in <a href='003trace.cc.html#L169'>trace</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L788" class="LineNr">788 </span> <span class="Delimiter">}</span> <span id="L789" class="LineNr">789 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L790" class="LineNr">790 </span> <span class="Delimiter">}</span> @@ -861,11 +861,11 @@ if ('onhashchange' in window) { <span id="L796" class="LineNr">796 </span><span class="Special">% Hide_errors = true;</span> <span id="L797" class="LineNr">797 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L798" class="LineNr">798 </span> run [ -<span id="L799" class="LineNr">799 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] +<span id="L799" class="LineNr">799 </span> <a href='003trace.cc.html#L169'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] <span id="L800" class="LineNr">800 </span> ] <span id="L801" class="LineNr">801 </span> check-trace-count-<span class="Normal">for</span>-label <span class="Constant">2</span><span class="Delimiter">,</span> [a] <span id="L802" class="LineNr">802 </span>] -<span id="L803" class="LineNr">803 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: expected 2 lines in <a href='003trace.cc.html#L171'>trace</a> with label 'a' in <a href='003trace.cc.html#L171'>trace</a></span> +<span id="L803" class="LineNr">803 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: expected 2 lines in <a href='003trace.cc.html#L169'>trace</a> with label 'a' in <a href='003trace.cc.html#L169'>trace</a></span> <span id="L804" class="LineNr">804 </span> <span id="L805" class="LineNr">805 </span><span class="Comment">//: Minor detail: ignore 'system' calls in scenarios, since anything we do</span> <span id="L806" class="LineNr">806 </span><span class="Comment">//: with them is by definition impossible to test through Mu.</span> @@ -890,11 +890,11 @@ if ('onhashchange' in window) { <span id="L825" class="LineNr">825 </span><span class="Delimiter">}</span> <span id="L826" class="LineNr">826 </span> <span id="L827" class="LineNr">827 </span><span class="Delimiter">:(after "void transform_all()")</span> -<span id="L828" class="LineNr">828 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<recipe_ordinal<span class="Delimiter">,</span> recipe>::iterator p = Recipe<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Recipe<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L828" class="LineNr">828 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<recipe_ordinal<span class="Delimiter">,</span> recipe>::iterator p = Recipe<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Recipe<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L829" class="LineNr">829 </span> <span class="Normal">const</span> recipe& r = p<span class="Delimiter">-></span>second<span class="Delimiter">;</span> <span id="L830" class="LineNr">830 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>name<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">'_'</span><span class="Delimiter">)</span> == string::npos<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L831" class="LineNr">831 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>is_autogenerated<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// created by previous call to transform_all()</span> -<span id="L832" class="LineNr">832 </span> <a href='003trace.cc.html#L178'>raise</a> << r<span class="Delimiter">.</span>name << <span class="Constant">": don't create recipes with '_' in the name</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L832" class="LineNr">832 </span> <a href='003trace.cc.html#L176'>raise</a> << r<span class="Delimiter">.</span>name << <span class="Constant">": don't create recipes with '_' in the name</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L833" class="LineNr">833 </span> <span class="Delimiter">}</span> <span id="L834" class="LineNr">834 </span> <span id="L835" class="LineNr">835 </span><span class="SalientComment">//:: Helpers</span> @@ -909,7 +909,7 @@ if ('onhashchange' in window) { <span id="L844" class="LineNr">844 </span> string _scenario = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L845" class="LineNr">845 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>_scenario<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L846" class="LineNr">846 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L847" class="LineNr">847 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"no <a href='050scenario.cc.html#L57'>scenario</a> in string passed into run_mu_scenario()</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L847" class="LineNr">847 </span> <a href='003trace.cc.html#L176'>raise</a> << <span class="Constant">"no <a href='050scenario.cc.html#L57'>scenario</a> in string passed into run_mu_scenario()</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> <span id="L848" class="LineNr">848 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L849" class="LineNr">849 </span> <span class="Delimiter">}</span> <span id="L850" class="LineNr">850 </span> assert<span class="Delimiter">(</span>_scenario == <span class="Constant">"scenario"</span><span class="Delimiter">);</span> |