coverage/index.html in regexp-examples-0.2.1 vs coverage/index.html in regexp-examples-0.2.2

- old
+ new

@@ -12,30 +12,30 @@ <body> <div id="loading"> <img src="./assets/0.8.0/loading.gif" alt="loading"/> </div> <div id="wrapper" style="display:none;"> - <div class="timestamp">Generated <abbr class="timeago" title="2015-01-14T17:27:23+00:00">2015-01-14T17:27:23+00:00</abbr></div> + <div class="timestamp">Generated <abbr class="timeago" title="2015-01-15T10:09:55+00:00">2015-01-15T10:09:55+00:00</abbr></div> <ul class="group_tabs"></ul> <div id="content"> <div class="file_list_container" id="AllFiles"> <h2> <span class="group_name">All Files</span> (<span class="covered_percent"><span class="green">100.0%</span></span> covered at <span class="covered_strength"> <span class="green"> - 50.45 + 75.39 </span> </span> hits/line) </h2> <a name="AllFiles"></a> <div> - <b>9</b> files in total. - <b>297</b> relevant lines. - <span class="green"><b>297</b> lines covered</span> and + <b>10</b> files in total. + <b>298</b> relevant lines. + <span class="green"><b>298</b> lines covered</span> and <span class="red"><b>0</b> lines missed </span> </div> <table class="file_list"> <thead> <tr> @@ -55,21 +55,21 @@ <td class="green strong">100.0 %</td> <td>2</td> <td>1</td> <td>1</td> <td>0</td> - <td>9.0</td> + <td>10.0</td> </tr> <tr> <td class="strong"><a href="#29a2a933bc8a3e2979023518566420381fb495fb" class="src_link" title="lib/regexp-examples/backreferences.rb">lib/regexp-examples/backreferences.rb</a></td> <td class="green strong">100.0 %</td> - <td>52</td> - <td>28</td> - <td>28</td> + <td>21</td> + <td>11</td> + <td>11</td> <td>0</td> - <td>65.3</td> + <td>44.3</td> </tr> <tr> <td class="strong"><a href="#e85042a89399d7715f4d8400e118fda97215b72c" class="src_link" title="lib/regexp-examples/constants.rb">lib/regexp-examples/constants.rb</a></td> <td class="green strong">100.0 %</td> @@ -79,47 +79,57 @@ <td>0</td> <td>6.8</td> </tr> <tr> + <td class="strong"><a href="#1e3a4050d8206287a142d9723d2991d09a3f7a81" class="src_link" title="lib/regexp-examples/exceptions.rb">lib/regexp-examples/exceptions.rb</a></td> + <td class="green strong">100.0 %</td> + <td>5</td> + <td>4</td> + <td>4</td> + <td>0</td> + <td>1.0</td> + </tr> + + <tr> <td class="strong"><a href="#00d77fb2e4e21451442e29891ddf88bd05f0fbd7" class="src_link" title="lib/regexp-examples/groups.rb">lib/regexp-examples/groups.rb</a></td> <td class="green strong">100.0 %</td> - <td>119</td> - <td>65</td> - <td>65</td> + <td>145</td> + <td>77</td> + <td>77</td> <td>0</td> - <td>30.2</td> + <td>146.2</td> </tr> <tr> <td class="strong"><a href="#dad3c4bb6458db3261442a9292e1345b41afd730" class="src_link" title="lib/regexp-examples/helpers.rb">lib/regexp-examples/helpers.rb</a></td> <td class="green strong">100.0 %</td> - <td>36</td> - <td>15</td> - <td>15</td> + <td>26</td> + <td>10</td> + <td>10</td> <td>0</td> - <td>144.5</td> + <td>165.7</td> </tr> <tr> <td class="strong"><a href="#e013406b8d61f5ad15d0a3ad7ea7e8e96b6d7254" class="src_link" title="lib/regexp-examples/parser.rb">lib/regexp-examples/parser.rb</a></td> <td class="green strong">100.0 %</td> <td>184</td> - <td>102</td> - <td>102</td> + <td>104</td> + <td>104</td> <td>0</td> - <td>54.6</td> + <td>54.2</td> </tr> <tr> <td class="strong"><a href="#0dc204f32cb2876d2238a2aae7dea86ad7f9e679" class="src_link" title="lib/regexp-examples/regexp_extensions.rb">lib/regexp-examples/regexp_extensions.rb</a></td> <td class="green strong">100.0 %</td> - <td>16</td> - <td>9</td> - <td>9</td> + <td>14</td> + <td>8</td> + <td>8</td> <td>0</td> - <td>37.1</td> + <td>35.5</td> </tr> <tr> <td class="strong"><a href="#430477f0c86b2d77a18fe51e32b818d48ab7e74b" class="src_link" title="lib/regexp-examples/repeaters.rb">lib/regexp-examples/repeaters.rb</a></td> <td class="green strong">100.0 %</td> @@ -131,15 +141,15 @@ </tr> <tr> <td class="strong"><a href="#73ece59f571550448cda013ec330081f40e82321" class="src_link" title="spec/regexp-examples_spec.rb">spec/regexp-examples_spec.rb</a></td> <td class="green strong">100.0 %</td> - <td>113</td> - <td>22</td> - <td>22</td> + <td>124</td> + <td>28</td> + <td>28</td> <td>0</td> - <td>17.6</td> + <td>14.4</td> </tr> </tbody> </table> </div> @@ -168,12 +178,12 @@ </div> <pre> <ol> - <li class="covered" data-hits="9" data-linenumber="1"> - <span class="hits">9</span> + <li class="covered" data-hits="10" data-linenumber="1"> + <span class="hits">10</span> <code class="ruby">Dir[File.dirname(__FILE__) + &#39;/regexp-examples/*.rb&#39;].each {|file| require file }</code> </li> <li class="never" data-hits="" data-linenumber="2"> @@ -189,12 +199,12 @@ <div class="source_table" id="29a2a933bc8a3e2979023518566420381fb495fb"> <div class="header"> <h3>lib/regexp-examples/backreferences.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>28</b> relevant lines. - <span class="green"><b>28</b> lines covered</span> and + <b>11</b> relevant lines. + <span class="green"><b>11</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -207,308 +217,122 @@ </li> <li class="covered" data-hits="1" data-linenumber="2"> <span class="hits">1</span> - <code class="ruby"> class CaptureGroupResult &lt; String</code> + <code class="ruby"> class BackReferenceReplacer</code> </li> <li class="covered" data-hits="1" data-linenumber="3"> <span class="hits">1</span> - <code class="ruby"> attr_reader :group_id, :subgroups</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="4"> - <span class="hits">1</span> - - <code class="ruby"> def initialize(group_id, subgroups, values)</code> - </li> - - <li class="covered" data-hits="248" data-linenumber="5"> - <span class="hits">248</span> - - <code class="ruby"> @group_id = group_id</code> - </li> - - <li class="covered" data-hits="248" data-linenumber="6"> - <span class="hits">248</span> - - <code class="ruby"> @subgroups = subgroups</code> - </li> - - <li class="covered" data-hits="248" data-linenumber="7"> - <span class="hits">248</span> - - <code class="ruby"> super(values)</code> - </li> - - <li class="never" data-hits="" data-linenumber="8"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="9"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="10"> - <span class="hits">1</span> - - <code class="ruby"> def all_subgroups</code> - </li> - - <li class="covered" data-hits="168" data-linenumber="11"> - <span class="hits">168</span> - - <code class="ruby"> [self, subgroups].flatten</code> - </li> - - <li class="never" data-hits="" data-linenumber="12"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="13"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="14"> - - - <code class="ruby"> # Overridden in order to preserve the @group_id and @subgroups</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="15"> - <span class="hits">1</span> - - <code class="ruby"> def *(int)</code> - </li> - - <li class="covered" data-hits="79" data-linenumber="16"> - <span class="hits">79</span> - - <code class="ruby"> self.class.new(group_id, subgroups, super)</code> - </li> - - <li class="never" data-hits="" data-linenumber="17"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="18"> - - - <code class="ruby"> # Overridden in order to preserve the @group_id and @subgroups</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="19"> - <span class="hits">1</span> - - <code class="ruby"> def gsub(regex)</code> - </li> - - <li class="covered" data-hits="28" data-linenumber="20"> - <span class="hits">28</span> - - <code class="ruby"> self.class.new(group_id, subgroups, super)</code> - </li> - - <li class="never" data-hits="" data-linenumber="21"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="22"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="23"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="24"> - <span class="hits">1</span> - - <code class="ruby"> class BackReferenceReplacer</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="25"> - <span class="hits">1</span> - <code class="ruby"> def substitute_backreferences(full_examples)</code> </li> - <li class="covered" data-hits="54" data-linenumber="26"> + <li class="covered" data-hits="54" data-linenumber="4"> <span class="hits">54</span> - <code class="ruby"> full_examples.map! do |full_example|</code> + <code class="ruby"> full_examples.map do |full_example|</code> </li> - <li class="covered" data-hits="148" data-linenumber="27"> + <li class="covered" data-hits="148" data-linenumber="5"> <span class="hits">148</span> - <code class="ruby"> if full_example.is_a? String</code> + <code class="ruby"> while full_example.match(/__(\w+?)__/)</code> </li> - <li class="covered" data-hits="130" data-linenumber="28"> - <span class="hits">130</span> - - <code class="ruby"> [full_example]</code> - </li> - - <li class="never" data-hits="" data-linenumber="29"> - - - <code class="ruby"> else</code> - </li> - - <li class="covered" data-hits="18" data-linenumber="30"> - <span class="hits">18</span> - - <code class="ruby"> full_example.map! do |partial_example|</code> - </li> - - <li class="covered" data-hits="112" data-linenumber="31"> - <span class="hits">112</span> - - <code class="ruby"> partial_example.gsub(/__(\w+)__/) do |match|</code> - </li> - - <li class="covered" data-hits="28" data-linenumber="32"> + <li class="covered" data-hits="28" data-linenumber="6"> <span class="hits">28</span> - <code class="ruby"> find_backref_for(full_example, $1)</code> + <code class="ruby"> full_example.sub!(/__(\w+?)__/, find_backref_for(full_example, $1))</code> </li> - <li class="never" data-hits="" data-linenumber="33"> + <li class="never" data-hits="" data-linenumber="7"> - <code class="ruby"> end</code> + <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="34"> + <li class="covered" data-hits="148" data-linenumber="8"> + <span class="hits">148</span> - - <code class="ruby"> end</code> + <code class="ruby"> full_example</code> </li> - <li class="never" data-hits="" data-linenumber="35"> + <li class="never" data-hits="" data-linenumber="9"> - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="36"> - - <code class="ruby"> end</code> </li> - <li class="covered" data-hits="54" data-linenumber="37"> - <span class="hits">54</span> + <li class="never" data-hits="" data-linenumber="10"> - <code class="ruby"> full_examples</code> - </li> - - <li class="never" data-hits="" data-linenumber="38"> - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="39"> + <li class="never" data-hits="" data-linenumber="11"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="40"> + <li class="covered" data-hits="1" data-linenumber="12"> <span class="hits">1</span> <code class="ruby"> private</code> </li> - <li class="covered" data-hits="1" data-linenumber="41"> + <li class="covered" data-hits="1" data-linenumber="13"> <span class="hits">1</span> <code class="ruby"> def find_backref_for(full_example, group_id)</code> </li> - <li class="covered" data-hits="28" data-linenumber="42"> + <li class="covered" data-hits="28" data-linenumber="14"> <span class="hits">28</span> - <code class="ruby"> full_example.each do |partial_example|</code> + <code class="ruby"> full_example.all_subgroups.detect do |subgroup|</code> </li> - <li class="covered" data-hits="75" data-linenumber="43"> - <span class="hits">75</span> + <li class="covered" data-hits="76" data-linenumber="15"> + <span class="hits">76</span> - <code class="ruby"> next unless partial_example.respond_to?(:group_id)</code> + <code class="ruby"> subgroup.group_id == group_id</code> </li> - <li class="covered" data-hits="74" data-linenumber="44"> - <span class="hits">74</span> + <li class="never" data-hits="" data-linenumber="16"> - <code class="ruby"> partial_example.all_subgroups.each do |subgroup|</code> - </li> - - <li class="covered" data-hits="77" data-linenumber="45"> - <span class="hits">77</span> - <code class="ruby"> return subgroup if subgroup.group_id == group_id</code> - </li> - - <li class="never" data-hits="" data-linenumber="46"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="47"> - - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="48"> + <li class="never" data-hits="" data-linenumber="17"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="49"> + <li class="never" data-hits="" data-linenumber="18"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="50"> + <li class="never" data-hits="" data-linenumber="19"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="51"> + <li class="never" data-hits="" data-linenumber="20"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="52"> + <li class="never" data-hits="" data-linenumber="21"> <code class="ruby">end</code> </li> @@ -784,17 +608,65 @@ </ol> </pre> </div> + <div class="source_table" id="1e3a4050d8206287a142d9723d2991d09a3f7a81"> + <div class="header"> + <h3>lib/regexp-examples/exceptions.rb</h3> + <h4><span class="green">100.0 %</span> covered</h4> + <div> + <b>4</b> relevant lines. + <span class="green"><b>4</b> lines covered</span> and + <span class="red"><b>0</b> lines missed.</span> + </div> + </div> + + <pre> + <ol> + + <li class="covered" data-hits="1" data-linenumber="1"> + <span class="hits">1</span> + + <code class="ruby">module RegexpExamples</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="2"> + <span class="hits">1</span> + + <code class="ruby"> class Error &lt; StandardError; end</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="3"> + <span class="hits">1</span> + + <code class="ruby"> class UnsupportedSyntaxError &lt; Error; end</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="4"> + <span class="hits">1</span> + + <code class="ruby"> class IllegalSyntaxError &lt; Error; end</code> + </li> + + <li class="never" data-hits="" data-linenumber="5"> + + + <code class="ruby">end</code> + </li> + + </ol> + </pre> +</div> + <div class="source_table" id="00d77fb2e4e21451442e29891ddf88bd05f0fbd7"> <div class="header"> <h3>lib/regexp-examples/groups.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>65</b> relevant lines. - <span class="green"><b>65</b> lines covered</span> and + <b>77</b> relevant lines. + <span class="green"><b>77</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -804,713 +676,869 @@ <span class="hits">1</span> <code class="ruby">module RegexpExamples</code> </li> - <li class="covered" data-hits="1" data-linenumber="2"> + <li class="never" data-hits="" data-linenumber="2"> + + + <code class="ruby"> # All Group#result methods return an array of GroupResult objects</code> + </li> + + <li class="never" data-hits="" data-linenumber="3"> + + + <code class="ruby"> # The key objective here is to keep track of all capture groups, in order</code> + </li> + + <li class="never" data-hits="" data-linenumber="4"> + + + <code class="ruby"> # to fill in backreferences</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="5"> <span class="hits">1</span> + <code class="ruby"> class GroupResult &lt; String</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="6"> + <span class="hits">1</span> + + <code class="ruby"> attr_reader :group_id, :subgroups</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="7"> + <span class="hits">1</span> + + <code class="ruby"> def initialize(result, group_id = nil, subgroups = [])</code> + </li> + + <li class="covered" data-hits="1633" data-linenumber="8"> + <span class="hits">1633</span> + + <code class="ruby"> @group_id = group_id</code> + </li> + + <li class="covered" data-hits="1633" data-linenumber="9"> + <span class="hits">1633</span> + + <code class="ruby"> @subgroups = subgroups</code> + </li> + + <li class="covered" data-hits="1633" data-linenumber="10"> + <span class="hits">1633</span> + + <code class="ruby"> if result.respond_to?(:group_id)</code> + </li> + + <li class="covered" data-hits="122" data-linenumber="11"> + <span class="hits">122</span> + + <code class="ruby"> @subgroups = result.all_subgroups</code> + </li> + + <li class="never" data-hits="" data-linenumber="12"> + + + <code class="ruby"> end</code> + </li> + + <li class="covered" data-hits="1633" data-linenumber="13"> + <span class="hits">1633</span> + + <code class="ruby"> super(result)</code> + </li> + + <li class="never" data-hits="" data-linenumber="14"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="15"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="16"> + <span class="hits">1</span> + + <code class="ruby"> def all_subgroups</code> + </li> + + <li class="covered" data-hits="1667" data-linenumber="17"> + <span class="hits">1667</span> + + <code class="ruby"> [self, subgroups].flatten.reject { |subgroup| subgroup.group_id.nil? }</code> + </li> + + <li class="never" data-hits="" data-linenumber="18"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="19"> + + + <code class="ruby"></code> + </li> + + <li class="never" data-hits="" data-linenumber="20"> + + + <code class="ruby"> # Overridden in order to preserve the @group_id and @subgroups</code> + </li> + + <li class="never" data-hits="" data-linenumber="21"> + + + <code class="ruby"> # Used by BaseGroup (which, in turn, is used by all Group objects)</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="22"> + <span class="hits">1</span> + + <code class="ruby"> def *(int)</code> + </li> + + <li class="covered" data-hits="413" data-linenumber="23"> + <span class="hits">413</span> + + <code class="ruby"> self.class.new(super.to_s, group_id, subgroups)</code> + </li> + + <li class="never" data-hits="" data-linenumber="24"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="25"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="26"> + + + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="27"> + <span class="hits">1</span> + <code class="ruby"> class SingleCharGroup</code> </li> - <li class="covered" data-hits="1" data-linenumber="3"> + <li class="covered" data-hits="1" data-linenumber="28"> <span class="hits">1</span> <code class="ruby"> def initialize(char)</code> </li> - <li class="covered" data-hits="175" data-linenumber="4"> + <li class="covered" data-hits="175" data-linenumber="29"> <span class="hits">175</span> <code class="ruby"> @char = char</code> </li> - <li class="never" data-hits="" data-linenumber="5"> + <li class="never" data-hits="" data-linenumber="30"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="6"> + <li class="covered" data-hits="1" data-linenumber="31"> <span class="hits">1</span> <code class="ruby"> def result</code> </li> - <li class="covered" data-hits="175" data-linenumber="7"> + <li class="covered" data-hits="175" data-linenumber="32"> <span class="hits">175</span> - <code class="ruby"> [@char]</code> + <code class="ruby"> [GroupResult.new(@char)]</code> </li> - <li class="never" data-hits="" data-linenumber="8"> + <li class="never" data-hits="" data-linenumber="33"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="9"> + <li class="never" data-hits="" data-linenumber="34"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="10"> + <li class="never" data-hits="" data-linenumber="35"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="11"> + <li class="covered" data-hits="1" data-linenumber="36"> <span class="hits">1</span> <code class="ruby"> class CharGroup</code> </li> - <li class="covered" data-hits="1" data-linenumber="12"> + <li class="covered" data-hits="1" data-linenumber="37"> <span class="hits">1</span> <code class="ruby"> def initialize(chars)</code> </li> - <li class="covered" data-hits="28" data-linenumber="13"> + <li class="covered" data-hits="28" data-linenumber="38"> <span class="hits">28</span> <code class="ruby"> @chars = chars</code> </li> - <li class="covered" data-hits="28" data-linenumber="14"> + <li class="covered" data-hits="28" data-linenumber="39"> <span class="hits">28</span> <code class="ruby"> if chars[0] == &quot;^&quot;</code> </li> - <li class="covered" data-hits="1" data-linenumber="15"> + <li class="covered" data-hits="1" data-linenumber="40"> <span class="hits">1</span> <code class="ruby"> @negative = true</code> </li> - <li class="covered" data-hits="1" data-linenumber="16"> + <li class="covered" data-hits="1" data-linenumber="41"> <span class="hits">1</span> <code class="ruby"> @chars = @chars[1..-1]</code> </li> - <li class="never" data-hits="" data-linenumber="17"> + <li class="never" data-hits="" data-linenumber="42"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="27" data-linenumber="18"> + <li class="covered" data-hits="27" data-linenumber="43"> <span class="hits">27</span> <code class="ruby"> @negative = false</code> </li> - <li class="never" data-hits="" data-linenumber="19"> + <li class="never" data-hits="" data-linenumber="44"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="20"> + <li class="never" data-hits="" data-linenumber="45"> <code class="ruby"></code> </li> - <li class="covered" data-hits="28" data-linenumber="21"> + <li class="covered" data-hits="28" data-linenumber="46"> <span class="hits">28</span> <code class="ruby"> init_backslash_chars</code> </li> - <li class="covered" data-hits="28" data-linenumber="22"> + <li class="covered" data-hits="28" data-linenumber="47"> <span class="hits">28</span> <code class="ruby"> init_ranges</code> </li> - <li class="never" data-hits="" data-linenumber="23"> + <li class="never" data-hits="" data-linenumber="48"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="24"> + <li class="never" data-hits="" data-linenumber="49"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="25"> + <li class="covered" data-hits="1" data-linenumber="50"> <span class="hits">1</span> <code class="ruby"> def init_ranges</code> </li> - <li class="never" data-hits="" data-linenumber="26"> + <li class="never" data-hits="" data-linenumber="51"> <code class="ruby"> # save first and last &quot;-&quot; if present</code> </li> - <li class="covered" data-hits="28" data-linenumber="27"> + <li class="covered" data-hits="28" data-linenumber="52"> <span class="hits">28</span> <code class="ruby"> first = nil</code> </li> - <li class="covered" data-hits="28" data-linenumber="28"> + <li class="covered" data-hits="28" data-linenumber="53"> <span class="hits">28</span> <code class="ruby"> last = nil</code> </li> - <li class="covered" data-hits="28" data-linenumber="29"> + <li class="covered" data-hits="28" data-linenumber="54"> <span class="hits">28</span> <code class="ruby"> first = @chars.shift if @chars.first == &quot;-&quot;</code> </li> - <li class="covered" data-hits="28" data-linenumber="30"> + <li class="covered" data-hits="28" data-linenumber="55"> <span class="hits">28</span> <code class="ruby"> last = @chars.pop if @chars.last == &quot;-&quot;</code> </li> - <li class="never" data-hits="" data-linenumber="31"> + <li class="never" data-hits="" data-linenumber="56"> <code class="ruby"> # Replace all instances of e.g. [&quot;a&quot; &quot;-&quot; &quot;z&quot;] with [&quot;a&quot;, &quot;b&quot;, ..., &quot;z&quot;]</code> </li> - <li class="covered" data-hits="28" data-linenumber="32"> + <li class="covered" data-hits="28" data-linenumber="57"> <span class="hits">28</span> <code class="ruby"> while i = @chars.index(&quot;-&quot;)</code> </li> - <li class="covered" data-hits="9" data-linenumber="33"> + <li class="covered" data-hits="9" data-linenumber="58"> <span class="hits">9</span> <code class="ruby"> @chars[i-1..i+1] = (@chars[i-1]..@chars[i+1]).to_a</code> </li> - <li class="never" data-hits="" data-linenumber="34"> + <li class="never" data-hits="" data-linenumber="59"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="35"> + <li class="never" data-hits="" data-linenumber="60"> <code class="ruby"> # restore them back</code> </li> - <li class="covered" data-hits="28" data-linenumber="36"> + <li class="covered" data-hits="28" data-linenumber="61"> <span class="hits">28</span> <code class="ruby"> @chars.unshift(first) if first</code> </li> - <li class="covered" data-hits="28" data-linenumber="37"> + <li class="covered" data-hits="28" data-linenumber="62"> <span class="hits">28</span> <code class="ruby"> @chars.push(last) if last</code> </li> - <li class="never" data-hits="" data-linenumber="38"> + <li class="never" data-hits="" data-linenumber="63"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="39"> + <li class="never" data-hits="" data-linenumber="64"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="40"> + <li class="covered" data-hits="1" data-linenumber="65"> <span class="hits">1</span> <code class="ruby"> def init_backslash_chars</code> </li> - <li class="covered" data-hits="28" data-linenumber="41"> + <li class="covered" data-hits="28" data-linenumber="66"> <span class="hits">28</span> <code class="ruby"> @chars.each_with_index do |char, i|</code> </li> - <li class="covered" data-hits="540" data-linenumber="42"> + <li class="covered" data-hits="540" data-linenumber="67"> <span class="hits">540</span> <code class="ruby"> if char == &quot;\\&quot;</code> </li> - <li class="covered" data-hits="13" data-linenumber="43"> + <li class="covered" data-hits="13" data-linenumber="68"> <span class="hits">13</span> <code class="ruby"> if BackslashCharMap.keys.include?(@chars[i+1])</code> </li> - <li class="covered" data-hits="4" data-linenumber="44"> + <li class="covered" data-hits="4" data-linenumber="69"> <span class="hits">4</span> <code class="ruby"> @chars[i..i+1] = BackslashCharMap[@chars[i+1]]</code> </li> - <li class="never" data-hits="" data-linenumber="45"> + <li class="never" data-hits="" data-linenumber="70"> <code class="ruby"> elsif @chars[i+1] == &quot;\\&quot;</code> </li> - <li class="covered" data-hits="2" data-linenumber="46"> + <li class="covered" data-hits="2" data-linenumber="71"> <span class="hits">2</span> <code class="ruby"> @chars.delete_at(i+1)</code> </li> - <li class="never" data-hits="" data-linenumber="47"> + <li class="never" data-hits="" data-linenumber="72"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="7" data-linenumber="48"> + <li class="covered" data-hits="7" data-linenumber="73"> <span class="hits">7</span> <code class="ruby"> @chars.delete_at(i)</code> </li> - <li class="never" data-hits="" data-linenumber="49"> + <li class="never" data-hits="" data-linenumber="74"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="50"> + <li class="never" data-hits="" data-linenumber="75"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="51"> + <li class="never" data-hits="" data-linenumber="76"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="52"> + <li class="never" data-hits="" data-linenumber="77"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="53"> + <li class="never" data-hits="" data-linenumber="78"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="54"> + <li class="covered" data-hits="1" data-linenumber="79"> <span class="hits">1</span> <code class="ruby"> def result</code> </li> - <li class="covered" data-hits="28" data-linenumber="55"> + <li class="covered" data-hits="28" data-linenumber="80"> <span class="hits">28</span> - <code class="ruby"> if @negative</code> + <code class="ruby"> (@negative ? (CharSets::Any - @chars) : @chars).map do |result|</code> </li> - <li class="covered" data-hits="1" data-linenumber="56"> - <span class="hits">1</span> + <li class="covered" data-hits="572" data-linenumber="81"> + <span class="hits">572</span> - <code class="ruby"> CharSets::Any - @chars</code> + <code class="ruby"> GroupResult.new(result)</code> </li> - <li class="never" data-hits="" data-linenumber="57"> + <li class="never" data-hits="" data-linenumber="82"> - <code class="ruby"> else</code> - </li> - - <li class="covered" data-hits="27" data-linenumber="58"> - <span class="hits">27</span> - - <code class="ruby"> @chars</code> - </li> - - <li class="never" data-hits="" data-linenumber="59"> - - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="60"> + <li class="never" data-hits="" data-linenumber="83"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="61"> + <li class="never" data-hits="" data-linenumber="84"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="62"> + <li class="never" data-hits="" data-linenumber="85"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="63"> + <li class="covered" data-hits="1" data-linenumber="86"> <span class="hits">1</span> <code class="ruby"> class DotGroup</code> </li> - <li class="covered" data-hits="1" data-linenumber="64"> + <li class="covered" data-hits="1" data-linenumber="87"> <span class="hits">1</span> <code class="ruby"> def result</code> </li> - <li class="covered" data-hits="1" data-linenumber="65"> + <li class="covered" data-hits="1" data-linenumber="88"> <span class="hits">1</span> - <code class="ruby"> CharSets::Any</code> + <code class="ruby"> CharSets::Any.map do |result|</code> </li> - <li class="never" data-hits="" data-linenumber="66"> + <li class="covered" data-hits="94" data-linenumber="89"> + <span class="hits">94</span> + <code class="ruby"> GroupResult.new(result)</code> + </li> + + <li class="never" data-hits="" data-linenumber="90"> + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="91"> + + <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="67"> + <li class="never" data-hits="" data-linenumber="92"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="68"> + <li class="never" data-hits="" data-linenumber="93"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="69"> + <li class="covered" data-hits="1" data-linenumber="94"> <span class="hits">1</span> <code class="ruby"> class MultiGroup</code> </li> - <li class="covered" data-hits="1" data-linenumber="70"> + <li class="covered" data-hits="1" data-linenumber="95"> <span class="hits">1</span> <code class="ruby"> attr_reader :group_id</code> </li> - <li class="covered" data-hits="1" data-linenumber="71"> + <li class="covered" data-hits="1" data-linenumber="96"> <span class="hits">1</span> <code class="ruby"> def initialize(groups, group_id)</code> </li> - <li class="covered" data-hits="41" data-linenumber="72"> + <li class="covered" data-hits="41" data-linenumber="97"> <span class="hits">41</span> <code class="ruby"> @groups = groups</code> </li> - <li class="covered" data-hits="41" data-linenumber="73"> + <li class="covered" data-hits="41" data-linenumber="98"> <span class="hits">41</span> <code class="ruby"> @group_id = group_id</code> </li> - <li class="never" data-hits="" data-linenumber="74"> + <li class="never" data-hits="" data-linenumber="99"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="75"> + <li class="never" data-hits="" data-linenumber="100"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="76"> + <li class="never" data-hits="" data-linenumber="101"> <code class="ruby"> # Generates the result of each contained group</code> </li> - <li class="never" data-hits="" data-linenumber="77"> + <li class="never" data-hits="" data-linenumber="102"> <code class="ruby"> # and adds the filled group of each result to</code> </li> - <li class="never" data-hits="" data-linenumber="78"> + <li class="never" data-hits="" data-linenumber="103"> <code class="ruby"> # itself</code> </li> - <li class="covered" data-hits="1" data-linenumber="79"> + <li class="covered" data-hits="1" data-linenumber="104"> <span class="hits">1</span> <code class="ruby"> def result</code> </li> - <li class="covered" data-hits="186" data-linenumber="80"> + <li class="covered" data-hits="186" data-linenumber="105"> <span class="hits">186</span> <code class="ruby"> strings = @groups.map {|repeater| repeater.result}</code> </li> - <li class="covered" data-hits="41" data-linenumber="81"> + <li class="covered" data-hits="41" data-linenumber="106"> <span class="hits">41</span> <code class="ruby"> RegexpExamples::permutations_of_strings(strings).map do |result|</code> </li> - <li class="covered" data-hits="101" data-linenumber="82"> + <li class="covered" data-hits="101" data-linenumber="107"> <span class="hits">101</span> - <code class="ruby"> subgroups = result.respond_to?(:group_id) ? result.all_subgroups : []</code> + <code class="ruby"> GroupResult.new(result, group_id)</code> </li> - <li class="covered" data-hits="101" data-linenumber="83"> - <span class="hits">101</span> + <li class="never" data-hits="" data-linenumber="108"> - <code class="ruby"> group_id ? CaptureGroupResult.new(group_id, subgroups, result) : result</code> - </li> - - <li class="never" data-hits="" data-linenumber="84"> - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="85"> + <li class="never" data-hits="" data-linenumber="109"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="86"> + <li class="never" data-hits="" data-linenumber="110"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="87"> + <li class="never" data-hits="" data-linenumber="111"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="88"> + <li class="covered" data-hits="1" data-linenumber="112"> <span class="hits">1</span> <code class="ruby"> class MultiGroupEnd</code> </li> - <li class="never" data-hits="" data-linenumber="89"> + <li class="never" data-hits="" data-linenumber="113"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="90"> + <li class="never" data-hits="" data-linenumber="114"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="91"> + <li class="covered" data-hits="1" data-linenumber="115"> <span class="hits">1</span> <code class="ruby"> class OrGroup</code> </li> - <li class="covered" data-hits="1" data-linenumber="92"> + <li class="covered" data-hits="1" data-linenumber="116"> <span class="hits">1</span> <code class="ruby"> def initialize(left_repeaters, right_repeaters)</code> </li> - <li class="covered" data-hits="6" data-linenumber="93"> + <li class="covered" data-hits="6" data-linenumber="117"> <span class="hits">6</span> <code class="ruby"> @left_repeaters = left_repeaters</code> </li> - <li class="covered" data-hits="6" data-linenumber="94"> + <li class="covered" data-hits="6" data-linenumber="118"> <span class="hits">6</span> <code class="ruby"> @right_repeaters = right_repeaters</code> </li> - <li class="never" data-hits="" data-linenumber="95"> + <li class="never" data-hits="" data-linenumber="119"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="96"> + <li class="never" data-hits="" data-linenumber="120"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="97"> + <li class="covered" data-hits="1" data-linenumber="121"> <span class="hits">1</span> <code class="ruby"> def result</code> </li> - <li class="covered" data-hits="6" data-linenumber="98"> + <li class="covered" data-hits="6" data-linenumber="122"> <span class="hits">6</span> <code class="ruby"> left_result = @left_repeaters.map do |repeater|</code> </li> - <li class="covered" data-hits="6" data-linenumber="99"> + <li class="covered" data-hits="6" data-linenumber="123"> <span class="hits">6</span> <code class="ruby"> RegexpExamples::permutations_of_strings([repeater.result])</code> </li> - <li class="never" data-hits="" data-linenumber="100"> + <li class="never" data-hits="" data-linenumber="124"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="6" data-linenumber="101"> + <li class="covered" data-hits="6" data-linenumber="125"> <span class="hits">6</span> <code class="ruby"> right_result = @right_repeaters.map do |repeater|</code> </li> - <li class="covered" data-hits="6" data-linenumber="102"> + <li class="covered" data-hits="6" data-linenumber="126"> <span class="hits">6</span> <code class="ruby"> RegexpExamples::permutations_of_strings([repeater.result])</code> </li> - <li class="never" data-hits="" data-linenumber="103"> + <li class="never" data-hits="" data-linenumber="127"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="6" data-linenumber="104"> + <li class="covered" data-hits="6" data-linenumber="128"> <span class="hits">6</span> - <code class="ruby"> left_result.concat(right_result).flatten.uniq</code> + <code class="ruby"> left_result.concat(right_result).flatten.uniq.map do |result|</code> </li> - <li class="never" data-hits="" data-linenumber="105"> + <li class="covered" data-hits="21" data-linenumber="129"> + <span class="hits">21</span> + <code class="ruby"> GroupResult.new(result)</code> + </li> + + <li class="never" data-hits="" data-linenumber="130"> + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="131"> + + <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="106"> + <li class="never" data-hits="" data-linenumber="132"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="107"> + <li class="never" data-hits="" data-linenumber="133"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="108"> + <li class="covered" data-hits="1" data-linenumber="134"> <span class="hits">1</span> <code class="ruby"> class BackReferenceGroup</code> </li> - <li class="covered" data-hits="1" data-linenumber="109"> + <li class="covered" data-hits="1" data-linenumber="135"> <span class="hits">1</span> <code class="ruby"> attr_reader :id</code> </li> - <li class="covered" data-hits="1" data-linenumber="110"> + <li class="covered" data-hits="1" data-linenumber="136"> <span class="hits">1</span> <code class="ruby"> def initialize(id)</code> </li> - <li class="covered" data-hits="20" data-linenumber="111"> + <li class="covered" data-hits="20" data-linenumber="137"> <span class="hits">20</span> <code class="ruby"> @id = id</code> </li> - <li class="never" data-hits="" data-linenumber="112"> + <li class="never" data-hits="" data-linenumber="138"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="113"> + <li class="never" data-hits="" data-linenumber="139"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="114"> + <li class="covered" data-hits="1" data-linenumber="140"> <span class="hits">1</span> <code class="ruby"> def result</code> </li> - <li class="covered" data-hits="20" data-linenumber="115"> + <li class="covered" data-hits="20" data-linenumber="141"> <span class="hits">20</span> - <code class="ruby"> [&quot;__#{@id}__&quot;]</code> + <code class="ruby"> [ GroupResult.new(&quot;__#{@id}__&quot;) ]</code> </li> - <li class="never" data-hits="" data-linenumber="116"> + <li class="never" data-hits="" data-linenumber="142"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="117"> + <li class="never" data-hits="" data-linenumber="143"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="118"> + <li class="never" data-hits="" data-linenumber="144"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="119"> + <li class="never" data-hits="" data-linenumber="145"> <code class="ruby">end</code> </li> @@ -1521,12 +1549,12 @@ <div class="source_table" id="dad3c4bb6458db3261442a9292e1345b41afd730"> <div class="header"> <h3>lib/regexp-examples/helpers.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>15</b> relevant lines. - <span class="green"><b>15</b> lines covered</span> and + <b>10</b> relevant lines. + <span class="green"><b>10</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -1611,140 +1639,80 @@ </li> <li class="covered" data-hits="237" data-linenumber="14"> <span class="hits">237</span> - <code class="ruby"> if options[:no_join]</code> + <code class="ruby"> join_preserving_capture_groups(result)</code> </li> - <li class="covered" data-hits="73" data-linenumber="15"> - <span class="hits">73</span> + <li class="never" data-hits="" data-linenumber="15"> - <code class="ruby"> result.flatten</code> - </li> - - <li class="never" data-hits="" data-linenumber="16"> - - <code class="ruby"> else</code> - </li> - - <li class="covered" data-hits="164" data-linenumber="17"> - <span class="hits">164</span> - - <code class="ruby"> join_preserving_capture_groups(result)</code> - </li> - - <li class="never" data-hits="" data-linenumber="18"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="19"> - - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="20"> + <li class="never" data-hits="" data-linenumber="16"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="21"> + <li class="never" data-hits="" data-linenumber="17"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="22"> + <li class="covered" data-hits="1" data-linenumber="18"> <span class="hits">1</span> <code class="ruby"> def self.join_preserving_capture_groups(result)</code> </li> - <li class="covered" data-hits="164" data-linenumber="23"> - <span class="hits">164</span> + <li class="covered" data-hits="237" data-linenumber="19"> + <span class="hits">237</span> <code class="ruby"> result.flatten!</code> </li> - <li class="covered" data-hits="164" data-linenumber="24"> - <span class="hits">164</span> + <li class="covered" data-hits="237" data-linenumber="20"> + <span class="hits">237</span> <code class="ruby"> subgroups = result</code> </li> - <li class="covered" data-hits="328" data-linenumber="25"> - <span class="hits">328</span> + <li class="never" data-hits="" data-linenumber="21"> - <code class="ruby"> .select { |partial| partial.respond_to? :group_id }</code> - </li> - - <li class="never" data-hits="" data-linenumber="26"> - <code class="ruby"> .map(&amp;:all_subgroups)</code> </li> - <li class="never" data-hits="" data-linenumber="27"> + <li class="never" data-hits="" data-linenumber="22"> <code class="ruby"> .flatten</code> </li> - <li class="never" data-hits="" data-linenumber="28"> + <li class="covered" data-hits="237" data-linenumber="23"> + <span class="hits">237</span> - - <code class="ruby"></code> + <code class="ruby"> GroupResult.new(result.join, nil, subgroups)</code> </li> - <li class="covered" data-hits="164" data-linenumber="29"> - <span class="hits">164</span> + <li class="never" data-hits="" data-linenumber="24"> - <code class="ruby"> if subgroups.empty?</code> - </li> - - <li class="covered" data-hits="123" data-linenumber="30"> - <span class="hits">123</span> - <code class="ruby"> result.join</code> - </li> - - <li class="never" data-hits="" data-linenumber="31"> - - - <code class="ruby"> else</code> - </li> - - <li class="covered" data-hits="41" data-linenumber="32"> - <span class="hits">41</span> - - <code class="ruby"> CaptureGroupResult.new(nil, subgroups, result.join)</code> - </li> - - <li class="never" data-hits="" data-linenumber="33"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="34"> - - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="35"> + <li class="never" data-hits="" data-linenumber="25"> <code class="ruby">end</code> </li> - <li class="never" data-hits="" data-linenumber="36"> + <li class="never" data-hits="" data-linenumber="26"> <code class="ruby"></code> </li> @@ -1755,12 +1723,12 @@ <div class="source_table" id="e013406b8d61f5ad15d0a3ad7ea7e8e96b6d7254"> <div class="header"> <h3>lib/regexp-examples/parser.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>102</b> relevant lines. - <span class="green"><b>102</b> lines covered</span> and + <b>104</b> relevant lines. + <span class="green"><b>104</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -1788,24 +1756,24 @@ <span class="hits">1</span> <code class="ruby"> def initialize(regexp_string)</code> </li> - <li class="covered" data-hits="54" data-linenumber="5"> - <span class="hits">54</span> + <li class="covered" data-hits="58" data-linenumber="5"> + <span class="hits">58</span> <code class="ruby"> @regexp_string = regexp_string</code> </li> - <li class="covered" data-hits="54" data-linenumber="6"> - <span class="hits">54</span> + <li class="covered" data-hits="58" data-linenumber="6"> + <span class="hits">58</span> <code class="ruby"> @num_groups = 0</code> </li> - <li class="covered" data-hits="54" data-linenumber="7"> - <span class="hits">54</span> + <li class="covered" data-hits="58" data-linenumber="7"> + <span class="hits">58</span> <code class="ruby"> @current_position = 0</code> </li> <li class="never" data-hits="" data-linenumber="8"> @@ -1824,24 +1792,24 @@ <span class="hits">1</span> <code class="ruby"> def parse</code> </li> - <li class="covered" data-hits="101" data-linenumber="11"> - <span class="hits">101</span> + <li class="covered" data-hits="105" data-linenumber="11"> + <span class="hits">105</span> <code class="ruby"> repeaters = []</code> </li> - <li class="covered" data-hits="101" data-linenumber="12"> - <span class="hits">101</span> + <li class="covered" data-hits="105" data-linenumber="12"> + <span class="hits">105</span> <code class="ruby"> while @current_position &lt; regexp_string.length</code> </li> - <li class="covered" data-hits="312" data-linenumber="13"> - <span class="hits">312</span> + <li class="covered" data-hits="316" data-linenumber="13"> + <span class="hits">316</span> <code class="ruby"> group = parse_group(repeaters)</code> </li> <li class="covered" data-hits="312" data-linenumber="14"> @@ -1908,30 +1876,30 @@ <span class="hits">1</span> <code class="ruby"> def parse_group(repeaters)</code> </li> - <li class="covered" data-hits="312" data-linenumber="25"> - <span class="hits">312</span> + <li class="covered" data-hits="316" data-linenumber="25"> + <span class="hits">316</span> <code class="ruby"> char = regexp_string[@current_position]</code> </li> - <li class="covered" data-hits="312" data-linenumber="26"> - <span class="hits">312</span> + <li class="covered" data-hits="316" data-linenumber="26"> + <span class="hits">316</span> <code class="ruby"> case char</code> </li> <li class="never" data-hits="" data-linenumber="27"> <code class="ruby"> when &#39;(&#39;</code> </li> - <li class="covered" data-hits="41" data-linenumber="28"> - <span class="hits">41</span> + <li class="covered" data-hits="45" data-linenumber="28"> + <span class="hits">45</span> <code class="ruby"> group = parse_multi_group</code> </li> <li class="never" data-hits="" data-linenumber="29"> @@ -2262,30 +2230,30 @@ <span class="hits">1</span> <code class="ruby"> def parse_multi_group</code> </li> - <li class="covered" data-hits="41" data-linenumber="84"> - <span class="hits">41</span> + <li class="covered" data-hits="45" data-linenumber="84"> + <span class="hits">45</span> <code class="ruby"> @current_position += 1</code> </li> - <li class="covered" data-hits="41" data-linenumber="85"> - <span class="hits">41</span> + <li class="covered" data-hits="45" data-linenumber="85"> + <span class="hits">45</span> <code class="ruby"> @num_groups += 1</code> </li> - <li class="covered" data-hits="41" data-linenumber="86"> - <span class="hits">41</span> + <li class="covered" data-hits="45" data-linenumber="86"> + <span class="hits">45</span> <code class="ruby"> group_id = nil # init</code> </li> - <li class="covered" data-hits="41" data-linenumber="87"> - <span class="hits">41</span> + <li class="covered" data-hits="45" data-linenumber="87"> + <span class="hits">45</span> <code class="ruby"> rest_of_string.match(/\A(\?)?(:|!|=|&lt;(!|=|[^!=][^&gt;]*))?/) do |match|</code> </li> <li class="never" data-hits="" data-linenumber="88"> @@ -2328,26 +2296,26 @@ <code class="ruby"> when %w(! =).include?(match[2]) # e.g. /(?=lookahead)/, /(?!neglookahead)/</code> </li> - <li class="never" data-hits="" data-linenumber="95"> + <li class="covered" data-hits="2" data-linenumber="95"> + <span class="hits">2</span> - - <code class="ruby"> # TODO: Raise exception</code> + <code class="ruby"> raise IllegalSyntaxError, &quot;Lookaheads are not regular; cannot generate examples&quot;</code> </li> <li class="never" data-hits="" data-linenumber="96"> <code class="ruby"> when %w(! =).include?(match[3]) # e.g. /(?&lt;=lookbehind)/, /(?&lt;!neglookbehind)/</code> </li> - <li class="never" data-hits="" data-linenumber="97"> + <li class="covered" data-hits="2" data-linenumber="97"> + <span class="hits">2</span> - - <code class="ruby"> # TODO: Raise exception</code> + <code class="ruby"> raise IllegalSyntaxError, &quot;Lookbehinds are not regular; cannot generate examples&quot;</code> </li> <li class="never" data-hits="" data-linenumber="98"> @@ -2364,12 +2332,12 @@ <span class="hits">2</span> <code class="ruby"> group_id = match[3]</code> </li> - <li class="covered" data-hits="41" data-linenumber="101"> - <span class="hits">41</span> + <li class="covered" data-hits="45" data-linenumber="101"> + <span class="hits">45</span> <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="102"> @@ -2838,12 +2806,12 @@ <span class="hits">1</span> <code class="ruby"> def rest_of_string</code> </li> - <li class="covered" data-hits="98" data-linenumber="180"> - <span class="hits">98</span> + <li class="covered" data-hits="102" data-linenumber="180"> + <span class="hits">102</span> <code class="ruby"> regexp_string[@current_position..-1]</code> </li> <li class="never" data-hits="" data-linenumber="181"> @@ -2877,12 +2845,12 @@ <div class="source_table" id="0dc204f32cb2876d2238a2aae7dea86ad7f9e679"> <div class="header"> <h3>lib/regexp-examples/regexp_extensions.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>9</b> relevant lines. - <span class="green"><b>9</b> lines covered</span> and + <b>8</b> relevant lines. + <span class="green"><b>8</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -2904,12 +2872,12 @@ <span class="hits">1</span> <code class="ruby"> def examples</code> </li> - <li class="covered" data-hits="54" data-linenumber="4"> - <span class="hits">54</span> + <li class="covered" data-hits="58" data-linenumber="4"> + <span class="hits">58</span> <code class="ruby"> partial_examples =</code> </li> <li class="never" data-hits="" data-linenumber="5"> @@ -2919,68 +2887,56 @@ </li> <li class="never" data-hits="" data-linenumber="6"> - <code class="ruby"> .parse</code> + <code class="ruby"> .parse</code> </li> <li class="covered" data-hits="114" data-linenumber="7"> <span class="hits">114</span> - <code class="ruby"> .map {|repeater| repeater.result}</code> + <code class="ruby"> .map {|repeater| repeater.result}</code> </li> <li class="covered" data-hits="54" data-linenumber="8"> <span class="hits">54</span> - <code class="ruby"> full_examples = RegexpExamples::permutations_of_strings(partial_examples.dup, no_join: true)</code> + <code class="ruby"> full_examples = RegexpExamples::permutations_of_strings(partial_examples)</code> </li> <li class="covered" data-hits="54" data-linenumber="9"> <span class="hits">54</span> - <code class="ruby"> full_examples_with_backrefs = \</code> + <code class="ruby"> RegexpExamples::BackReferenceReplacer.new.substitute_backreferences(full_examples)</code> </li> <li class="never" data-hits="" data-linenumber="10"> - <code class="ruby"> RegexpExamples::BackReferenceReplacer.new.substitute_backreferences(full_examples)</code> - </li> - - <li class="covered" data-hits="54" data-linenumber="11"> - <span class="hits">54</span> - - <code class="ruby"> full_examples_with_backrefs.map(&amp;:join)</code> - </li> - - <li class="never" data-hits="" data-linenumber="12"> - - <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="13"> + <li class="never" data-hits="" data-linenumber="11"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="14"> + <li class="covered" data-hits="1" data-linenumber="12"> <span class="hits">1</span> <code class="ruby"> include Examples</code> </li> - <li class="never" data-hits="" data-linenumber="15"> + <li class="never" data-hits="" data-linenumber="13"> <code class="ruby">end</code> </li> - <li class="never" data-hits="" data-linenumber="16"> + <li class="never" data-hits="" data-linenumber="14"> <code class="ruby"></code> </li> @@ -3477,12 +3433,12 @@ <div class="source_table" id="73ece59f571550448cda013ec330081f40e82321"> <div class="header"> <h3>spec/regexp-examples_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>22</b> relevant lines. - <span class="green"><b>22</b> lines covered</span> and + <b>28</b> relevant lines. + <span class="green"><b>28</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -3579,589 +3535,655 @@ </li> <li class="covered" data-hits="1" data-linenumber="16"> <span class="hits">1</span> - <code class="ruby"> context &#39;returns matching strings&#39; do</code> + <code class="ruby"> def self.examples_raise_illegal_syntax_error(*regexps)</code> </li> <li class="covered" data-hits="1" data-linenumber="17"> <span class="hits">1</span> - <code class="ruby"> context &quot;for basic repeaters&quot; do</code> + <code class="ruby"> regexps.each do |regexp|</code> </li> - <li class="covered" data-hits="1" data-linenumber="18"> - <span class="hits">1</span> + <li class="covered" data-hits="4" data-linenumber="18"> + <span class="hits">4</span> - <code class="ruby"> examples_exist_and_match(</code> + <code class="ruby"> it do</code> </li> - <li class="never" data-hits="" data-linenumber="19"> + <li class="covered" data-hits="8" data-linenumber="19"> + <span class="hits">8</span> - - <code class="ruby"> /a/,</code> + <code class="ruby"> expect{regexp.examples}.to raise_error RegexpExamples::IllegalSyntaxError</code> </li> <li class="never" data-hits="" data-linenumber="20"> - <code class="ruby"> /a*/,</code> + <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="21"> - <code class="ruby"> /a+/,</code> + <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="22"> - <code class="ruby"> /a?/,</code> + <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="23"> - <code class="ruby"> /a{1}/,</code> + <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="24"> + <li class="covered" data-hits="1" data-linenumber="24"> + <span class="hits">1</span> - - <code class="ruby"> /a{1,}/,</code> + <code class="ruby"> context &#39;returns matching strings&#39; do</code> </li> - <li class="never" data-hits="" data-linenumber="25"> + <li class="covered" data-hits="1" data-linenumber="25"> + <span class="hits">1</span> - - <code class="ruby"> /a{1,2}/</code> + <code class="ruby"> context &quot;for basic repeaters&quot; do</code> </li> - <li class="never" data-hits="" data-linenumber="26"> + <li class="covered" data-hits="1" data-linenumber="26"> + <span class="hits">1</span> - - <code class="ruby"> )</code> + <code class="ruby"> examples_exist_and_match(</code> </li> <li class="never" data-hits="" data-linenumber="27"> - <code class="ruby"> end</code> + <code class="ruby"> /a/,</code> </li> <li class="never" data-hits="" data-linenumber="28"> - <code class="ruby"></code> + <code class="ruby"> /a*/,</code> </li> - <li class="covered" data-hits="1" data-linenumber="29"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="29"> - <code class="ruby"> context &quot;for basic groups&quot; do</code> + + <code class="ruby"> /a+/,</code> </li> - <li class="covered" data-hits="1" data-linenumber="30"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="30"> - <code class="ruby"> examples_exist_and_match(</code> + + <code class="ruby"> /a?/,</code> </li> <li class="never" data-hits="" data-linenumber="31"> - <code class="ruby"> /[a]/,</code> + <code class="ruby"> /a{1}/,</code> </li> <li class="never" data-hits="" data-linenumber="32"> - <code class="ruby"> /(a)/,</code> + <code class="ruby"> /a{1,}/,</code> </li> <li class="never" data-hits="" data-linenumber="33"> - <code class="ruby"> /a|b/,</code> + <code class="ruby"> /a{1,2}/</code> </li> <li class="never" data-hits="" data-linenumber="34"> - <code class="ruby"> /./</code> + <code class="ruby"> )</code> </li> <li class="never" data-hits="" data-linenumber="35"> - <code class="ruby"> )</code> + <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="36"> - <code class="ruby"> end</code> + <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="37"> + <li class="covered" data-hits="1" data-linenumber="37"> + <span class="hits">1</span> - - <code class="ruby"></code> + <code class="ruby"> context &quot;for basic groups&quot; do</code> </li> <li class="covered" data-hits="1" data-linenumber="38"> <span class="hits">1</span> - <code class="ruby"> context &quot;for complex char groups (square brackets)&quot; do</code> + <code class="ruby"> examples_exist_and_match(</code> </li> - <li class="covered" data-hits="1" data-linenumber="39"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="39"> - <code class="ruby"> examples_exist_and_match(</code> + + <code class="ruby"> /[a]/,</code> </li> <li class="never" data-hits="" data-linenumber="40"> - <code class="ruby"> /[abc]/,</code> + <code class="ruby"> /(a)/,</code> </li> <li class="never" data-hits="" data-linenumber="41"> - <code class="ruby"> /[a-c]/,</code> + <code class="ruby"> /a|b/,</code> </li> <li class="never" data-hits="" data-linenumber="42"> - <code class="ruby"> /[abc-e]/,</code> + <code class="ruby"> /./</code> </li> <li class="never" data-hits="" data-linenumber="43"> - <code class="ruby"> /[^a-zA-Z]/,</code> + <code class="ruby"> )</code> </li> <li class="never" data-hits="" data-linenumber="44"> - <code class="ruby"> /[\w]/,</code> + <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="45"> - <code class="ruby"> /[]]/, # TODO: How to suppress annoying warnings on this test?</code> + <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="46"> + <li class="covered" data-hits="1" data-linenumber="46"> + <span class="hits">1</span> - - <code class="ruby"> /[\]]/,</code> + <code class="ruby"> context &quot;for complex char groups (square brackets)&quot; do</code> </li> - <li class="never" data-hits="" data-linenumber="47"> + <li class="covered" data-hits="1" data-linenumber="47"> + <span class="hits">1</span> - - <code class="ruby"> /[\\]/,</code> + <code class="ruby"> examples_exist_and_match(</code> </li> <li class="never" data-hits="" data-linenumber="48"> - <code class="ruby"> /[\\\]]/,</code> + <code class="ruby"> /[abc]/,</code> </li> <li class="never" data-hits="" data-linenumber="49"> - <code class="ruby"> /[\n-\r]/,</code> + <code class="ruby"> /[a-c]/,</code> </li> <li class="never" data-hits="" data-linenumber="50"> - <code class="ruby"> /[\-]/,</code> + <code class="ruby"> /[abc-e]/,</code> </li> <li class="never" data-hits="" data-linenumber="51"> - <code class="ruby"> /[%-+]/ # This regex is &quot;supposed to&quot; match some surprising things!!!</code> + <code class="ruby"> /[^a-zA-Z]/,</code> </li> <li class="never" data-hits="" data-linenumber="52"> - <code class="ruby"> )</code> + <code class="ruby"> /[\w]/,</code> </li> <li class="never" data-hits="" data-linenumber="53"> - <code class="ruby"> end</code> + <code class="ruby"> /[]]/, # TODO: How to suppress annoying warnings on this test?</code> </li> <li class="never" data-hits="" data-linenumber="54"> - <code class="ruby"></code> + <code class="ruby"> /[\]]/,</code> </li> - <li class="covered" data-hits="1" data-linenumber="55"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="55"> - <code class="ruby"> context &quot;for complex multi groups&quot; do</code> + + <code class="ruby"> /[\\]/,</code> </li> - <li class="covered" data-hits="1" data-linenumber="56"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="56"> - <code class="ruby"> examples_exist_and_match(</code> + + <code class="ruby"> /[\\\]]/,</code> </li> <li class="never" data-hits="" data-linenumber="57"> - <code class="ruby"> /(normal)/,</code> + <code class="ruby"> /[\n-\r]/,</code> </li> <li class="never" data-hits="" data-linenumber="58"> - <code class="ruby"> /(?:nocapture)/,</code> + <code class="ruby"> /[\-]/,</code> </li> <li class="never" data-hits="" data-linenumber="59"> - <code class="ruby"> /(?&lt;name&gt;namedgroup)/,</code> + <code class="ruby"> /[%-+]/ # This regex is &quot;supposed to&quot; match some surprising things!!!</code> </li> <li class="never" data-hits="" data-linenumber="60"> - <code class="ruby"> /(?&lt;name&gt;namedgroup) \k&lt;name&gt;/</code> + <code class="ruby"> )</code> </li> <li class="never" data-hits="" data-linenumber="61"> - <code class="ruby"> )</code> + <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="62"> - <code class="ruby"> # TODO: These are not yet implemented</code> + <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="63"> + <li class="covered" data-hits="1" data-linenumber="63"> + <span class="hits">1</span> - - <code class="ruby"> # (expect to raise exception)</code> + <code class="ruby"> context &quot;for complex multi groups&quot; do</code> </li> - <li class="never" data-hits="" data-linenumber="64"> + <li class="covered" data-hits="1" data-linenumber="64"> + <span class="hits">1</span> - - <code class="ruby"># /(?=lookahead)/,</code> + <code class="ruby"> examples_exist_and_match(</code> </li> <li class="never" data-hits="" data-linenumber="65"> - <code class="ruby"># /(?!neglookahead)/,</code> + <code class="ruby"> /(normal)/,</code> </li> <li class="never" data-hits="" data-linenumber="66"> - <code class="ruby"># /(?&lt;=lookbehind)/,</code> + <code class="ruby"> /(?:nocapture)/,</code> </li> <li class="never" data-hits="" data-linenumber="67"> - <code class="ruby"># /(?&lt;!neglookbehind)/,</code> + <code class="ruby"> /(?&lt;name&gt;namedgroup)/,</code> </li> <li class="never" data-hits="" data-linenumber="68"> - <code class="ruby"> end</code> + <code class="ruby"> /(?&lt;name&gt;namedgroup) \k&lt;name&gt;/</code> </li> <li class="never" data-hits="" data-linenumber="69"> + <code class="ruby"> )</code> + </li> + + <li class="never" data-hits="" data-linenumber="70"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="71"> + + <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="70"> + <li class="covered" data-hits="1" data-linenumber="72"> <span class="hits">1</span> <code class="ruby"> context &quot;for escaped characters&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="71"> + <li class="covered" data-hits="1" data-linenumber="73"> <span class="hits">1</span> <code class="ruby"> examples_exist_and_match(</code> </li> - <li class="never" data-hits="" data-linenumber="72"> + <li class="never" data-hits="" data-linenumber="74"> <code class="ruby"> /\w/,</code> </li> - <li class="never" data-hits="" data-linenumber="73"> + <li class="never" data-hits="" data-linenumber="75"> <code class="ruby"> /\W/,</code> </li> - <li class="never" data-hits="" data-linenumber="74"> + <li class="never" data-hits="" data-linenumber="76"> <code class="ruby"> /\s/,</code> </li> - <li class="never" data-hits="" data-linenumber="75"> + <li class="never" data-hits="" data-linenumber="77"> <code class="ruby"> /\S/,</code> </li> - <li class="never" data-hits="" data-linenumber="76"> + <li class="never" data-hits="" data-linenumber="78"> <code class="ruby"> /\d/,</code> </li> - <li class="never" data-hits="" data-linenumber="77"> + <li class="never" data-hits="" data-linenumber="79"> <code class="ruby"> /\D/,</code> </li> - <li class="never" data-hits="" data-linenumber="78"> + <li class="never" data-hits="" data-linenumber="80"> <code class="ruby"> /\h/,</code> </li> - <li class="never" data-hits="" data-linenumber="79"> + <li class="never" data-hits="" data-linenumber="81"> <code class="ruby"> /\H/,</code> </li> - <li class="never" data-hits="" data-linenumber="80"> + <li class="never" data-hits="" data-linenumber="82"> <code class="ruby"> /\t/,</code> </li> - <li class="never" data-hits="" data-linenumber="81"> + <li class="never" data-hits="" data-linenumber="83"> <code class="ruby"> /\n/,</code> </li> - <li class="never" data-hits="" data-linenumber="82"> + <li class="never" data-hits="" data-linenumber="84"> <code class="ruby"> /\f/,</code> </li> - <li class="never" data-hits="" data-linenumber="83"> + <li class="never" data-hits="" data-linenumber="85"> <code class="ruby"> /\a/,</code> </li> - <li class="never" data-hits="" data-linenumber="84"> + <li class="never" data-hits="" data-linenumber="86"> <code class="ruby"> /\v/,</code> </li> - <li class="never" data-hits="" data-linenumber="85"> + <li class="never" data-hits="" data-linenumber="87"> <code class="ruby"> /\e/</code> </li> - <li class="never" data-hits="" data-linenumber="86"> + <li class="never" data-hits="" data-linenumber="88"> <code class="ruby"> )</code> </li> - <li class="never" data-hits="" data-linenumber="87"> + <li class="never" data-hits="" data-linenumber="89"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="88"> + <li class="never" data-hits="" data-linenumber="90"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="89"> + <li class="covered" data-hits="1" data-linenumber="91"> <span class="hits">1</span> <code class="ruby"> context &quot;for backreferences&quot; do</code> </li> - <li class="covered" data-hits="1" data-linenumber="90"> + <li class="covered" data-hits="1" data-linenumber="92"> <span class="hits">1</span> <code class="ruby"> examples_exist_and_match(</code> </li> - <li class="never" data-hits="" data-linenumber="91"> + <li class="never" data-hits="" data-linenumber="93"> <code class="ruby"> /(repeat) \1/,</code> </li> - <li class="never" data-hits="" data-linenumber="92"> + <li class="never" data-hits="" data-linenumber="94"> <code class="ruby"> /(ref1) (ref2) \1 \2/,</code> </li> - <li class="never" data-hits="" data-linenumber="93"> + <li class="never" data-hits="" data-linenumber="95"> <code class="ruby"> /((ref2)ref1) \1 \2/,</code> </li> - <li class="never" data-hits="" data-linenumber="94"> + <li class="never" data-hits="" data-linenumber="96"> <code class="ruby"> /((ref1and2)) \1 \2/,</code> </li> - <li class="never" data-hits="" data-linenumber="95"> + <li class="never" data-hits="" data-linenumber="97"> <code class="ruby"> /(one)(two)(three)(four)(five)(six)(seven)(eight)(nine)(ten) \10\9\8\7\6\5\4\3\2\1/,</code> </li> - <li class="never" data-hits="" data-linenumber="96"> + <li class="never" data-hits="" data-linenumber="98"> <code class="ruby"> /(a?(b?(c?(d?(e?)))))/</code> </li> - <li class="never" data-hits="" data-linenumber="97"> + <li class="never" data-hits="" data-linenumber="99"> <code class="ruby"> )</code> </li> - <li class="never" data-hits="" data-linenumber="98"> + <li class="never" data-hits="" data-linenumber="100"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="99"> + <li class="never" data-hits="" data-linenumber="101"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="100"> + <li class="covered" data-hits="1" data-linenumber="102"> <span class="hits">1</span> <code class="ruby"> context &quot;for complex patterns&quot; do</code> </li> - <li class="never" data-hits="" data-linenumber="101"> + <li class="never" data-hits="" data-linenumber="103"> <code class="ruby"> # Longer combinations of the above</code> </li> - <li class="covered" data-hits="1" data-linenumber="102"> + <li class="covered" data-hits="1" data-linenumber="104"> <span class="hits">1</span> <code class="ruby"> examples_exist_and_match(</code> </li> - <li class="never" data-hits="" data-linenumber="103"> + <li class="never" data-hits="" data-linenumber="105"> <code class="ruby"> /https?:\/\/(www\.)github\.com/,</code> </li> - <li class="never" data-hits="" data-linenumber="104"> + <li class="never" data-hits="" data-linenumber="106"> <code class="ruby"> /(I(N(C(E(P(T(I(O(N)))))))))*/,</code> </li> - <li class="never" data-hits="" data-linenumber="105"> + <li class="never" data-hits="" data-linenumber="107"> <code class="ruby"> /[\w]{1}/,</code> </li> - <li class="never" data-hits="" data-linenumber="106"> + <li class="never" data-hits="" data-linenumber="108"> <code class="ruby"> /((a?b*c+)) \1/,</code> </li> - <li class="never" data-hits="" data-linenumber="107"> + <li class="never" data-hits="" data-linenumber="109"> <code class="ruby"> /((a?b*c+)?) \1/,</code> </li> - <li class="never" data-hits="" data-linenumber="108"> + <li class="never" data-hits="" data-linenumber="110"> <code class="ruby"> /a|b|c|d/,</code> </li> - <li class="never" data-hits="" data-linenumber="109"> + <li class="never" data-hits="" data-linenumber="111"> <code class="ruby"> /a+|b*|c?/</code> </li> - <li class="never" data-hits="" data-linenumber="110"> + <li class="never" data-hits="" data-linenumber="112"> <code class="ruby"> )</code> </li> - <li class="never" data-hits="" data-linenumber="111"> + <li class="never" data-hits="" data-linenumber="113"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="112"> + <li class="never" data-hits="" data-linenumber="114"> + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="115"> + <span class="hits">1</span> + + <code class="ruby"> context &quot;for illegal syntax&quot; do</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="116"> + <span class="hits">1</span> + + <code class="ruby"> examples_raise_illegal_syntax_error(</code> + </li> + + <li class="never" data-hits="" data-linenumber="117"> + + + <code class="ruby"> /(?=lookahead)/,</code> + </li> + + <li class="never" data-hits="" data-linenumber="118"> + + + <code class="ruby"> /(?!neglookahead)/,</code> + </li> + + <li class="never" data-hits="" data-linenumber="119"> + + + <code class="ruby"> /(?&lt;=lookbehind)/,</code> + </li> + + <li class="never" data-hits="" data-linenumber="120"> + + + <code class="ruby"> /(?&lt;!neglookbehind)/</code> + </li> + + <li class="never" data-hits="" data-linenumber="121"> + + + <code class="ruby"> )</code> + </li> + + <li class="never" data-hits="" data-linenumber="122"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="123"> + + <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="113"> + <li class="never" data-hits="" data-linenumber="124"> <code class="ruby">end</code> </li>