coverage/index.html in regexp-examples-0.2.2 vs coverage/index.html in regexp-examples-0.2.3
- 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-15T10:09:55+00:00">2015-01-15T10:09:55+00:00</abbr></div>
+ <div class="timestamp">Generated <abbr class="timeago" title="2015-01-16T17:34:09+00:00">2015-01-16T17:34:09+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">
- 75.39
+ 75.85
</span>
</span> hits/line)
</h2>
<a name="AllFiles"></a>
<div>
<b>10</b> files in total.
- <b>298</b> relevant lines.
- <span class="green"><b>298</b> lines covered</span> and
+ <b>304</b> relevant lines.
+ <span class="green"><b>304</b> lines covered</span> and
<span class="red"><b>0</b> lines missed </span>
</div>
<table class="file_list">
<thead>
<tr>
@@ -65,11 +65,11 @@
<td class="green strong">100.0 %</td>
<td>21</td>
<td>11</td>
<td>11</td>
<td>0</td>
- <td>44.3</td>
+ <td>46.5</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>
@@ -95,61 +95,61 @@
<td class="green strong">100.0 %</td>
<td>145</td>
<td>77</td>
<td>77</td>
<td>0</td>
- <td>146.2</td>
+ <td>147.4</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>26</td>
<td>10</td>
<td>10</td>
<td>0</td>
- <td>165.7</td>
+ <td>167.1</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>104</td>
- <td>104</td>
+ <td>192</td>
+ <td>108</td>
+ <td>108</td>
<td>0</td>
- <td>54.2</td>
+ <td>55.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>14</td>
<td>8</td>
<td>8</td>
<td>0</td>
- <td>35.5</td>
+ <td>39.0</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>
<td>78</td>
<td>43</td>
<td>43</td>
<td>0</td>
- <td>61.5</td>
+ <td>63.1</td>
</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>124</td>
- <td>28</td>
- <td>28</td>
+ <td>136</td>
+ <td>30</td>
+ <td>30</td>
<td>0</td>
- <td>14.4</td>
+ <td>14.8</td>
</tr>
</tbody>
</table>
</div>
@@ -226,18 +226,18 @@
<span class="hits">1</span>
<code class="ruby"> def substitute_backreferences(full_examples)</code>
</li>
- <li class="covered" data-hits="54" data-linenumber="4">
- <span class="hits">54</span>
+ <li class="covered" data-hits="61" data-linenumber="4">
+ <span class="hits">61</span>
<code class="ruby"> full_examples.map do |full_example|</code>
</li>
- <li class="covered" data-hits="148" data-linenumber="5">
- <span class="hits">148</span>
+ <li class="covered" data-hits="157" data-linenumber="5">
+ <span class="hits">157</span>
<code class="ruby"> while full_example.match(/__(\w+?)__/)</code>
</li>
<li class="covered" data-hits="28" data-linenumber="6">
@@ -250,12 +250,12 @@
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="148" data-linenumber="8">
- <span class="hits">148</span>
+ <li class="covered" data-hits="157" data-linenumber="8">
+ <span class="hits">157</span>
<code class="ruby"> full_example</code>
</li>
<li class="never" data-hits="" data-linenumber="9">
@@ -712,24 +712,24 @@
<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>
+ <li class="covered" data-hits="1649" data-linenumber="8">
+ <span class="hits">1649</span>
<code class="ruby"> @group_id = group_id</code>
</li>
- <li class="covered" data-hits="1633" data-linenumber="9">
- <span class="hits">1633</span>
+ <li class="covered" data-hits="1649" data-linenumber="9">
+ <span class="hits">1649</span>
<code class="ruby"> @subgroups = subgroups</code>
</li>
- <li class="covered" data-hits="1633" data-linenumber="10">
- <span class="hits">1633</span>
+ <li class="covered" data-hits="1649" data-linenumber="10">
+ <span class="hits">1649</span>
<code class="ruby"> if result.respond_to?(:group_id)</code>
</li>
<li class="covered" data-hits="122" data-linenumber="11">
@@ -742,12 +742,12 @@
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1633" data-linenumber="13">
- <span class="hits">1633</span>
+ <li class="covered" data-hits="1649" data-linenumber="13">
+ <span class="hits">1649</span>
<code class="ruby"> super(result)</code>
</li>
<li class="never" data-hits="" data-linenumber="14">
@@ -802,12 +802,12 @@
<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>
+ <li class="covered" data-hits="422" data-linenumber="23">
+ <span class="hits">422</span>
<code class="ruby"> self.class.new(super.to_s, group_id, subgroups)</code>
</li>
<li class="never" data-hits="" data-linenumber="24">
@@ -838,12 +838,12 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(char)</code>
</li>
- <li class="covered" data-hits="175" data-linenumber="29">
- <span class="hits">175</span>
+ <li class="covered" data-hits="182" data-linenumber="29">
+ <span class="hits">182</span>
<code class="ruby"> @char = char</code>
</li>
<li class="never" data-hits="" data-linenumber="30">
@@ -856,12 +856,12 @@
<span class="hits">1</span>
<code class="ruby"> def result</code>
</li>
- <li class="covered" data-hits="175" data-linenumber="32">
- <span class="hits">175</span>
+ <li class="covered" data-hits="182" data-linenumber="32">
+ <span class="hits">182</span>
<code class="ruby"> [GroupResult.new(@char)]</code>
</li>
<li class="never" data-hits="" data-linenumber="33">
@@ -1618,18 +1618,18 @@
<span class="hits">1</span>
<code class="ruby"> def self.permutations_of_strings(arrays_of_strings, options={})</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="11">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="11">
+ <span class="hits">278</span>
<code class="ruby"> first = arrays_of_strings.shift</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="12">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="12">
+ <span class="hits">278</span>
<code class="ruby"> return first if arrays_of_strings.empty?</code>
</li>
<li class="covered" data-hits="164" data-linenumber="13">
@@ -1723,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>104</b> relevant lines.
- <span class="green"><b>104</b> lines covered</span> and
+ <b>108</b> relevant lines.
+ <span class="green"><b>108</b> lines covered</span> and
<span class="red"><b>0</b> lines missed.</span>
</div>
</div>
<pre>
@@ -1756,24 +1756,24 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(regexp_string)</code>
</li>
- <li class="covered" data-hits="58" data-linenumber="5">
- <span class="hits">58</span>
+ <li class="covered" data-hits="65" data-linenumber="5">
+ <span class="hits">65</span>
<code class="ruby"> @regexp_string = regexp_string</code>
</li>
- <li class="covered" data-hits="58" data-linenumber="6">
- <span class="hits">58</span>
+ <li class="covered" data-hits="65" data-linenumber="6">
+ <span class="hits">65</span>
<code class="ruby"> @num_groups = 0</code>
</li>
- <li class="covered" data-hits="58" data-linenumber="7">
- <span class="hits">58</span>
+ <li class="covered" data-hits="65" data-linenumber="7">
+ <span class="hits">65</span>
<code class="ruby"> @current_position = 0</code>
</li>
<li class="never" data-hits="" data-linenumber="8">
@@ -1792,60 +1792,60 @@
<span class="hits">1</span>
<code class="ruby"> def parse</code>
</li>
- <li class="covered" data-hits="105" data-linenumber="11">
- <span class="hits">105</span>
+ <li class="covered" data-hits="112" data-linenumber="11">
+ <span class="hits">112</span>
<code class="ruby"> repeaters = []</code>
</li>
- <li class="covered" data-hits="105" data-linenumber="12">
- <span class="hits">105</span>
+ <li class="covered" data-hits="112" data-linenumber="12">
+ <span class="hits">112</span>
<code class="ruby"> while @current_position < regexp_string.length</code>
</li>
- <li class="covered" data-hits="316" data-linenumber="13">
- <span class="hits">316</span>
+ <li class="covered" data-hits="323" data-linenumber="13">
+ <span class="hits">323</span>
<code class="ruby"> group = parse_group(repeaters)</code>
</li>
- <li class="covered" data-hits="312" data-linenumber="14">
- <span class="hits">312</span>
+ <li class="covered" data-hits="319" data-linenumber="14">
+ <span class="hits">319</span>
<code class="ruby"> break if group.is_a? MultiGroupEnd</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="15">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="15">
+ <span class="hits">278</span>
<code class="ruby"> repeaters = [] if group.is_a? OrGroup</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="16">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="16">
+ <span class="hits">278</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="17">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="17">
+ <span class="hits">278</span>
<code class="ruby"> repeaters << parse_repeater(group)</code>
</li>
<li class="never" data-hits="" data-linenumber="18">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="19">
- <span class="hits">101</span>
+ <li class="covered" data-hits="108" data-linenumber="19">
+ <span class="hits">108</span>
<code class="ruby"> repeaters</code>
</li>
<li class="never" data-hits="" data-linenumber="20">
@@ -1876,18 +1876,18 @@
<span class="hits">1</span>
<code class="ruby"> def parse_group(repeaters)</code>
</li>
- <li class="covered" data-hits="316" data-linenumber="25">
- <span class="hits">316</span>
+ <li class="covered" data-hits="323" data-linenumber="25">
+ <span class="hits">323</span>
<code class="ruby"> char = regexp_string[@current_position]</code>
</li>
- <li class="covered" data-hits="316" data-linenumber="26">
- <span class="hits">316</span>
+ <li class="covered" data-hits="323" data-linenumber="26">
+ <span class="hits">323</span>
<code class="ruby"> case char</code>
</li>
<li class="never" data-hits="" data-linenumber="27">
@@ -1954,36 +1954,36 @@
<code class="ruby"> when '\\'</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="38">
- <span class="hits">36</span>
+ <li class="covered" data-hits="42" data-linenumber="38">
+ <span class="hits">42</span>
<code class="ruby"> group = parse_after_backslash_group</code>
</li>
<li class="never" data-hits="" data-linenumber="39">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="173" data-linenumber="40">
- <span class="hits">173</span>
+ <li class="covered" data-hits="174" data-linenumber="40">
+ <span class="hits">174</span>
<code class="ruby"> group = parse_single_char_group(char)</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="312" data-linenumber="42">
- <span class="hits">312</span>
+ <li class="covered" data-hits="319" data-linenumber="42">
+ <span class="hits">319</span>
<code class="ruby"> group</code>
</li>
<li class="never" data-hits="" data-linenumber="43">
@@ -2002,12 +2002,12 @@
<span class="hits">1</span>
<code class="ruby"> def parse_after_backslash_group</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="46">
- <span class="hits">36</span>
+ <li class="covered" data-hits="42" data-linenumber="46">
+ <span class="hits">42</span>
<code class="ruby"> @current_position += 1</code>
</li>
<li class="never" data-hits="" data-linenumber="47">
@@ -2071,770 +2071,818 @@
</li>
<li class="never" data-hits="" data-linenumber="57">
+ <code class="ruby"> when rest_of_string =~ /\Ac(.)/ # Control character</code>
+ </li>
+
+ <li class="covered" data-hits="6" data-linenumber="58">
+ <span class="hits">6</span>
+
+ <code class="ruby"> @current_position += 1</code>
+ </li>
+
+ <li class="covered" data-hits="6" data-linenumber="59">
+ <span class="hits">6</span>
+
+ <code class="ruby"> group = parse_single_char_group( parse_control_character($1) )</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="60">
+
+
<code class="ruby"> # TODO: There are also a bunch of multi-char matches to watch out for:</code>
</li>
- <li class="never" data-hits="" data-linenumber="58">
+ <li class="never" data-hits="" data-linenumber="61">
<code class="ruby"> # http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Literals</code>
</li>
- <li class="never" data-hits="" data-linenumber="59">
+ <li class="never" data-hits="" data-linenumber="62">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="60">
+ <li class="covered" data-hits="2" data-linenumber="63">
<span class="hits">2</span>
<code class="ruby"> group = parse_single_char_group( regexp_string[@current_position] )</code>
</li>
- <li class="never" data-hits="" data-linenumber="61">
+ <li class="never" data-hits="" data-linenumber="64">
<code class="ruby"> # TODO: What about cases like \A, \z, \Z ?</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="62">
- <span class="hits">36</span>
+ <li class="covered" data-hits="42" data-linenumber="65">
+ <span class="hits">42</span>
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="63">
- <span class="hits">36</span>
+ <li class="covered" data-hits="42" data-linenumber="66">
+ <span class="hits">42</span>
<code class="ruby"> group</code>
</li>
- <li class="never" data-hits="" data-linenumber="64">
+ <li class="never" data-hits="" data-linenumber="67">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="65">
+ <li class="never" data-hits="" data-linenumber="68">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="66">
+ <li class="covered" data-hits="1" data-linenumber="69">
<span class="hits">1</span>
<code class="ruby"> def parse_repeater(group)</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="67">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="70">
+ <span class="hits">278</span>
<code class="ruby"> char = regexp_string[@current_position]</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="68">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="71">
+ <span class="hits">278</span>
<code class="ruby"> case char</code>
</li>
- <li class="never" data-hits="" data-linenumber="69">
+ <li class="never" data-hits="" data-linenumber="72">
<code class="ruby"> when '*'</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="70">
+ <li class="covered" data-hits="5" data-linenumber="73">
<span class="hits">5</span>
<code class="ruby"> repeater = parse_star_repeater(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="71">
+ <li class="never" data-hits="" data-linenumber="74">
<code class="ruby"> when '+'</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="72">
+ <li class="covered" data-hits="4" data-linenumber="75">
<span class="hits">4</span>
<code class="ruby"> repeater = parse_plus_repeater(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="73">
+ <li class="never" data-hits="" data-linenumber="76">
<code class="ruby"> when '?'</code>
</li>
- <li class="covered" data-hits="11" data-linenumber="74">
+ <li class="covered" data-hits="11" data-linenumber="77">
<span class="hits">11</span>
<code class="ruby"> repeater = parse_question_mark_repeater(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="75">
+ <li class="never" data-hits="" data-linenumber="78">
<code class="ruby"> when '{'</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="76">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="79">
+ <span class="hits">5</span>
<code class="ruby"> repeater = parse_range_repeater(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="77">
+ <li class="never" data-hits="" data-linenumber="80">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="247" data-linenumber="78">
- <span class="hits">247</span>
+ <li class="covered" data-hits="253" data-linenumber="81">
+ <span class="hits">253</span>
<code class="ruby"> repeater = parse_one_time_repeater(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="79">
+ <li class="never" data-hits="" data-linenumber="82">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="80">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="83">
+ <span class="hits">278</span>
<code class="ruby"> repeater</code>
</li>
- <li class="never" data-hits="" data-linenumber="81">
+ <li class="never" data-hits="" data-linenumber="84">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="82">
+ <li class="never" data-hits="" data-linenumber="85">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="83">
+ <li class="covered" data-hits="1" data-linenumber="86">
<span class="hits">1</span>
<code class="ruby"> def parse_multi_group</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="84">
+ <li class="covered" data-hits="45" data-linenumber="87">
<span class="hits">45</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="85">
+ <li class="covered" data-hits="45" data-linenumber="88">
<span class="hits">45</span>
<code class="ruby"> @num_groups += 1</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="86">
+ <li class="covered" data-hits="45" data-linenumber="89">
<span class="hits">45</span>
<code class="ruby"> group_id = nil # init</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="87">
+ <li class="covered" data-hits="45" data-linenumber="90">
<span class="hits">45</span>
<code class="ruby"> rest_of_string.match(/\A(\?)?(:|!|=|<(!|=|[^!=][^>]*))?/) do |match|</code>
</li>
- <li class="never" data-hits="" data-linenumber="88">
+ <li class="never" data-hits="" data-linenumber="91">
<code class="ruby"> case</code>
</li>
- <li class="never" data-hits="" data-linenumber="89">
+ <li class="never" data-hits="" data-linenumber="92">
<code class="ruby"> when match[1].nil? # e.g. /(normal)/</code>
</li>
- <li class="covered" data-hits="38" data-linenumber="90">
+ <li class="covered" data-hits="38" data-linenumber="93">
<span class="hits">38</span>
<code class="ruby"> group_id = @num_groups.to_s</code>
</li>
- <li class="never" data-hits="" data-linenumber="91">
+ <li class="never" data-hits="" data-linenumber="94">
<code class="ruby"> when match[2] == ':' # e.g. /(?:nocapture)/</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="92">
+ <li class="covered" data-hits="1" data-linenumber="95">
<span class="hits">1</span>
<code class="ruby"> @current_position += 2</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="93">
+ <li class="covered" data-hits="1" data-linenumber="96">
<span class="hits">1</span>
<code class="ruby"> group_id = nil</code>
</li>
- <li class="never" data-hits="" data-linenumber="94">
+ <li class="never" data-hits="" data-linenumber="97">
<code class="ruby"> when %w(! =).include?(match[2]) # e.g. /(?=lookahead)/, /(?!neglookahead)/</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="95">
+ <li class="covered" data-hits="2" data-linenumber="98">
<span class="hits">2</span>
<code class="ruby"> raise IllegalSyntaxError, "Lookaheads are not regular; cannot generate examples"</code>
</li>
- <li class="never" data-hits="" data-linenumber="96">
+ <li class="never" data-hits="" data-linenumber="99">
<code class="ruby"> when %w(! =).include?(match[3]) # e.g. /(?<=lookbehind)/, /(?<!neglookbehind)/</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="97">
+ <li class="covered" data-hits="2" data-linenumber="100">
<span class="hits">2</span>
<code class="ruby"> raise IllegalSyntaxError, "Lookbehinds are not regular; cannot generate examples"</code>
</li>
- <li class="never" data-hits="" data-linenumber="98">
+ <li class="never" data-hits="" data-linenumber="101">
<code class="ruby"> else # e.g. /(?<name>namedgroup)/</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="99">
+ <li class="covered" data-hits="2" data-linenumber="102">
<span class="hits">2</span>
<code class="ruby"> @current_position += (match[3].length + 3)</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="100">
+ <li class="covered" data-hits="2" data-linenumber="103">
<span class="hits">2</span>
<code class="ruby"> group_id = match[3]</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="101">
+ <li class="covered" data-hits="45" data-linenumber="104">
<span class="hits">45</span>
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="102">
+ <li class="never" data-hits="" data-linenumber="105">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="103">
+ <li class="covered" data-hits="41" data-linenumber="106">
<span class="hits">41</span>
<code class="ruby"> groups = parse</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="104">
+ <li class="covered" data-hits="41" data-linenumber="107">
<span class="hits">41</span>
<code class="ruby"> MultiGroup.new(groups, group_id)</code>
</li>
- <li class="never" data-hits="" data-linenumber="105">
+ <li class="never" data-hits="" data-linenumber="108">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="106">
+ <li class="never" data-hits="" data-linenumber="109">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="107">
+ <li class="covered" data-hits="1" data-linenumber="110">
<span class="hits">1</span>
<code class="ruby"> def parse_multi_end_group</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="108">
+ <li class="covered" data-hits="41" data-linenumber="111">
<span class="hits">41</span>
<code class="ruby"> MultiGroupEnd.new</code>
</li>
- <li class="never" data-hits="" data-linenumber="109">
+ <li class="never" data-hits="" data-linenumber="112">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="110">
+ <li class="never" data-hits="" data-linenumber="113">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="111">
+ <li class="covered" data-hits="1" data-linenumber="114">
<span class="hits">1</span>
<code class="ruby"> def parse_char_group</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="112">
+ <li class="covered" data-hits="14" data-linenumber="115">
<span class="hits">14</span>
<code class="ruby"> chars = []</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="113">
+ <li class="covered" data-hits="14" data-linenumber="116">
<span class="hits">14</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="114">
+ <li class="covered" data-hits="14" data-linenumber="117">
<span class="hits">14</span>
<code class="ruby"> if regexp_string[@current_position] == ']'</code>
</li>
- <li class="never" data-hits="" data-linenumber="115">
+ <li class="never" data-hits="" data-linenumber="118">
<code class="ruby"> # Beware of the sneaky edge case:</code>
</li>
- <li class="never" data-hits="" data-linenumber="116">
+ <li class="never" data-hits="" data-linenumber="119">
<code class="ruby"> # /[]]/ (match "]")</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="117">
+ <li class="covered" data-hits="1" data-linenumber="120">
<span class="hits">1</span>
<code class="ruby"> chars << ']'</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="118">
+ <li class="covered" data-hits="1" data-linenumber="121">
<span class="hits">1</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="never" data-hits="" data-linenumber="119">
+ <li class="never" data-hits="" data-linenumber="122">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="120">
+ <li class="never" data-hits="" data-linenumber="123">
<code class="ruby"> until regexp_string[@current_position] == ']' \</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="121">
+ <li class="covered" data-hits="14" data-linenumber="124">
<span class="hits">14</span>
<code class="ruby"> && !regexp_string[0..@current_position-1].match(/[^\\](\\{2})*\\\z/)</code>
</li>
- <li class="never" data-hits="" data-linenumber="122">
+ <li class="never" data-hits="" data-linenumber="125">
<code class="ruby"> # Beware of having an ODD number of "\" before the "]", e.g.</code>
</li>
- <li class="never" data-hits="" data-linenumber="123">
+ <li class="never" data-hits="" data-linenumber="126">
<code class="ruby"> # /[\]]/ (match "]")</code>
</li>
- <li class="never" data-hits="" data-linenumber="124">
+ <li class="never" data-hits="" data-linenumber="127">
<code class="ruby"> # /[\\]/ (match "\")</code>
</li>
- <li class="never" data-hits="" data-linenumber="125">
+ <li class="never" data-hits="" data-linenumber="128">
<code class="ruby"> # /[\\\]]/ (match "\" or "]")</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="126">
+ <li class="covered" data-hits="41" data-linenumber="129">
<span class="hits">41</span>
<code class="ruby"> chars << regexp_string[@current_position]</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="127">
+ <li class="covered" data-hits="41" data-linenumber="130">
<span class="hits">41</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="never" data-hits="" data-linenumber="128">
+ <li class="never" data-hits="" data-linenumber="131">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="129">
+ <li class="covered" data-hits="14" data-linenumber="132">
<span class="hits">14</span>
<code class="ruby"> CharGroup.new(chars)</code>
</li>
- <li class="never" data-hits="" data-linenumber="130">
+ <li class="never" data-hits="" data-linenumber="133">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="131">
+ <li class="never" data-hits="" data-linenumber="134">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="132">
+ <li class="covered" data-hits="1" data-linenumber="135">
<span class="hits">1</span>
<code class="ruby"> def parse_dot_group</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="133">
+ <li class="covered" data-hits="1" data-linenumber="136">
<span class="hits">1</span>
<code class="ruby"> DotGroup.new</code>
</li>
- <li class="never" data-hits="" data-linenumber="134">
+ <li class="never" data-hits="" data-linenumber="137">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="135">
+ <li class="never" data-hits="" data-linenumber="138">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="136">
+ <li class="covered" data-hits="1" data-linenumber="139">
<span class="hits">1</span>
<code class="ruby"> def parse_or_group(left_repeaters)</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="137">
+ <li class="covered" data-hits="6" data-linenumber="140">
<span class="hits">6</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="138">
+ <li class="covered" data-hits="6" data-linenumber="141">
<span class="hits">6</span>
<code class="ruby"> right_repeaters = parse</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="139">
+ <li class="covered" data-hits="6" data-linenumber="142">
<span class="hits">6</span>
<code class="ruby"> OrGroup.new(left_repeaters, right_repeaters)</code>
</li>
- <li class="never" data-hits="" data-linenumber="140">
+ <li class="never" data-hits="" data-linenumber="143">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="141">
+ <li class="never" data-hits="" data-linenumber="144">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="142">
+ <li class="never" data-hits="" data-linenumber="145">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="143">
+ <li class="covered" data-hits="1" data-linenumber="146">
<span class="hits">1</span>
<code class="ruby"> def parse_single_char_group(char)</code>
</li>
- <li class="covered" data-hits="175" data-linenumber="144">
- <span class="hits">175</span>
+ <li class="covered" data-hits="182" data-linenumber="147">
+ <span class="hits">182</span>
<code class="ruby"> SingleCharGroup.new(char)</code>
</li>
- <li class="never" data-hits="" data-linenumber="145">
+ <li class="never" data-hits="" data-linenumber="148">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="146">
+ <li class="never" data-hits="" data-linenumber="149">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="147">
+ <li class="covered" data-hits="1" data-linenumber="150">
<span class="hits">1</span>
<code class="ruby"> def parse_backreference_group(match)</code>
</li>
- <li class="covered" data-hits="20" data-linenumber="148">
+ <li class="covered" data-hits="20" data-linenumber="151">
<span class="hits">20</span>
<code class="ruby"> BackReferenceGroup.new(match)</code>
</li>
- <li class="never" data-hits="" data-linenumber="149">
+ <li class="never" data-hits="" data-linenumber="152">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="150">
+ <li class="never" data-hits="" data-linenumber="153">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="151">
+ <li class="covered" data-hits="1" data-linenumber="154">
<span class="hits">1</span>
+ <code class="ruby"> def parse_control_character(char)</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="155">
+
+
+ <code class="ruby"> # TODO: Is there a better way of doing this? I.e. not just brute-force</code>
+ </li>
+
+ <li class="covered" data-hits="125" data-linenumber="156">
+ <span class="hits">125</span>
+
+ <code class="ruby"> (0..255).detect { |x| x.chr =~ Regexp.new("\\c#{char}") }.chr</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="157">
+
+
+ <code class="ruby"> end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="158">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="159">
+ <span class="hits">1</span>
+
<code class="ruby"> def parse_star_repeater(group)</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="152">
+ <li class="covered" data-hits="5" data-linenumber="160">
<span class="hits">5</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="153">
+ <li class="covered" data-hits="5" data-linenumber="161">
<span class="hits">5</span>
<code class="ruby"> StarRepeater.new(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="154">
+ <li class="never" data-hits="" data-linenumber="162">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="155">
+ <li class="never" data-hits="" data-linenumber="163">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="156">
+ <li class="covered" data-hits="1" data-linenumber="164">
<span class="hits">1</span>
<code class="ruby"> def parse_plus_repeater(group)</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="157">
+ <li class="covered" data-hits="4" data-linenumber="165">
<span class="hits">4</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="158">
+ <li class="covered" data-hits="4" data-linenumber="166">
<span class="hits">4</span>
<code class="ruby"> PlusRepeater.new(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="159">
+ <li class="never" data-hits="" data-linenumber="167">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="160">
+ <li class="never" data-hits="" data-linenumber="168">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="161">
+ <li class="covered" data-hits="1" data-linenumber="169">
<span class="hits">1</span>
<code class="ruby"> def parse_question_mark_repeater(group)</code>
</li>
- <li class="covered" data-hits="11" data-linenumber="162">
+ <li class="covered" data-hits="11" data-linenumber="170">
<span class="hits">11</span>
<code class="ruby"> @current_position += 1</code>
</li>
- <li class="covered" data-hits="11" data-linenumber="163">
+ <li class="covered" data-hits="11" data-linenumber="171">
<span class="hits">11</span>
<code class="ruby"> QuestionMarkRepeater.new(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="164">
+ <li class="never" data-hits="" data-linenumber="172">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="165">
+ <li class="never" data-hits="" data-linenumber="173">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="166">
+ <li class="covered" data-hits="1" data-linenumber="174">
<span class="hits">1</span>
<code class="ruby"> def parse_range_repeater(group)</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="167">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="175">
+ <span class="hits">5</span>
- <code class="ruby"> match = rest_of_string.match(/\A\{(\d+)(,)?(\d+)?\}/)</code>
+ <code class="ruby"> match = rest_of_string.match(/\A\{(\d+)?(,)?(\d+)?\}/)</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="168">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="176">
+ <span class="hits">5</span>
<code class="ruby"> @current_position += match[0].size</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="169">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="177">
+ <span class="hits">5</span>
<code class="ruby"> min = match[1].to_i if match[1]</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="170">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="178">
+ <span class="hits">5</span>
<code class="ruby"> has_comma = !match[2].nil?</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="171">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="179">
+ <span class="hits">5</span>
<code class="ruby"> max = match[3].to_i if match[3]</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="172">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="180">
+ <span class="hits">5</span>
<code class="ruby"> RangeRepeater.new(group, min, has_comma, max)</code>
</li>
- <li class="never" data-hits="" data-linenumber="173">
+ <li class="never" data-hits="" data-linenumber="181">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="174">
+ <li class="never" data-hits="" data-linenumber="182">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="175">
+ <li class="covered" data-hits="1" data-linenumber="183">
<span class="hits">1</span>
<code class="ruby"> def parse_one_time_repeater(group)</code>
</li>
- <li class="covered" data-hits="247" data-linenumber="176">
- <span class="hits">247</span>
+ <li class="covered" data-hits="253" data-linenumber="184">
+ <span class="hits">253</span>
<code class="ruby"> OneTimeRepeater.new(group)</code>
</li>
- <li class="never" data-hits="" data-linenumber="177">
+ <li class="never" data-hits="" data-linenumber="185">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="178">
+ <li class="never" data-hits="" data-linenumber="186">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="179">
+ <li class="covered" data-hits="1" data-linenumber="187">
<span class="hits">1</span>
<code class="ruby"> def rest_of_string</code>
</li>
- <li class="covered" data-hits="102" data-linenumber="180">
- <span class="hits">102</span>
+ <li class="covered" data-hits="123" data-linenumber="188">
+ <span class="hits">123</span>
<code class="ruby"> regexp_string[@current_position..-1]</code>
</li>
- <li class="never" data-hits="" data-linenumber="181">
+ <li class="never" data-hits="" data-linenumber="189">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="182">
+ <li class="never" data-hits="" data-linenumber="190">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="183">
+ <li class="never" data-hits="" data-linenumber="191">
<code class="ruby">end</code>
</li>
- <li class="never" data-hits="" data-linenumber="184">
+ <li class="never" data-hits="" data-linenumber="192">
<code class="ruby"></code>
</li>
@@ -2872,12 +2920,12 @@
<span class="hits">1</span>
<code class="ruby"> def examples</code>
</li>
- <li class="covered" data-hits="58" data-linenumber="4">
- <span class="hits">58</span>
+ <li class="covered" data-hits="65" data-linenumber="4">
+ <span class="hits">65</span>
<code class="ruby"> partial_examples =</code>
</li>
<li class="never" data-hits="" data-linenumber="5">
@@ -2890,24 +2938,24 @@
<code class="ruby"> .parse</code>
</li>
- <li class="covered" data-hits="114" data-linenumber="7">
- <span class="hits">114</span>
+ <li class="covered" data-hits="121" data-linenumber="7">
+ <span class="hits">121</span>
<code class="ruby"> .map {|repeater| repeater.result}</code>
</li>
- <li class="covered" data-hits="54" data-linenumber="8">
- <span class="hits">54</span>
+ <li class="covered" data-hits="61" data-linenumber="8">
+ <span class="hits">61</span>
<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>
+ <li class="covered" data-hits="61" data-linenumber="9">
+ <span class="hits">61</span>
<code class="ruby"> RegexpExamples::BackReferenceReplacer.new.substitute_backreferences(full_examples)</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
@@ -2980,12 +3028,12 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(group)</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="5">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="5">
+ <span class="hits">278</span>
<code class="ruby"> @group = group</code>
</li>
<li class="never" data-hits="" data-linenumber="6">
@@ -3004,36 +3052,36 @@
<span class="hits">1</span>
<code class="ruby"> def result(min_repeats, max_repeats)</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="9">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="9">
+ <span class="hits">278</span>
<code class="ruby"> group_results = @group.result[0 .. MaxGroupResults-1]</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="10">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="10">
+ <span class="hits">278</span>
<code class="ruby"> results = []</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="11">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="11">
+ <span class="hits">278</span>
<code class="ruby"> min_repeats.upto(max_repeats) do |repeats|</code>
</li>
- <li class="covered" data-hits="299" data-linenumber="12">
- <span class="hits">299</span>
+ <li class="covered" data-hits="308" data-linenumber="12">
+ <span class="hits">308</span>
<code class="ruby"> group_results.each do |group_result|</code>
</li>
- <li class="covered" data-hits="413" data-linenumber="13">
- <span class="hits">413</span>
+ <li class="covered" data-hits="422" data-linenumber="13">
+ <span class="hits">422</span>
<code class="ruby"> results << group_result * repeats</code>
</li>
<li class="never" data-hits="" data-linenumber="14">
@@ -3046,12 +3094,12 @@
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="271" data-linenumber="16">
- <span class="hits">271</span>
+ <li class="covered" data-hits="278" data-linenumber="16">
+ <span class="hits">278</span>
<code class="ruby"> results.uniq</code>
</li>
<li class="never" data-hits="" data-linenumber="17">
@@ -3082,12 +3130,12 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(group)</code>
</li>
- <li class="covered" data-hits="247" data-linenumber="22">
- <span class="hits">247</span>
+ <li class="covered" data-hits="253" data-linenumber="22">
+ <span class="hits">253</span>
<code class="ruby"> super</code>
</li>
<li class="never" data-hits="" data-linenumber="23">
@@ -3106,12 +3154,12 @@
<span class="hits">1</span>
<code class="ruby"> def result</code>
</li>
- <li class="covered" data-hits="247" data-linenumber="26">
- <span class="hits">247</span>
+ <li class="covered" data-hits="253" data-linenumber="26">
+ <span class="hits">253</span>
<code class="ruby"> super(1, 1)</code>
</li>
<li class="never" data-hits="" data-linenumber="27">
@@ -3322,30 +3370,30 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(group, min, has_comma, max)</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="62">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="62">
+ <span class="hits">5</span>
<code class="ruby"> super(group)</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="63">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="63">
+ <span class="hits">5</span>
- <code class="ruby"> @min = min</code>
+ <code class="ruby"> @min = min || 0</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="64">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="64">
+ <span class="hits">5</span>
<code class="ruby"> if max</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="65">
- <span class="hits">1</span>
+ <li class="covered" data-hits="2" data-linenumber="65">
+ <span class="hits">2</span>
<code class="ruby"> @max = max</code>
</li>
<li class="covered" data-hits="3" data-linenumber="66">
@@ -3394,12 +3442,12 @@
<span class="hits">1</span>
<code class="ruby"> def result</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="74">
- <span class="hits">4</span>
+ <li class="covered" data-hits="5" data-linenumber="74">
+ <span class="hits">5</span>
<code class="ruby"> super(@min, @max)</code>
</li>
<li class="never" data-hits="" data-linenumber="75">
@@ -3433,12 +3481,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>28</b> relevant lines.
- <span class="green"><b>28</b> lines covered</span> and
+ <b>30</b> relevant lines.
+ <span class="green"><b>30</b> lines covered</span> and
<span class="red"><b>0</b> lines missed.</span>
</div>
</div>
<pre>
@@ -3454,36 +3502,36 @@
<span class="hits">1</span>
<code class="ruby"> def self.examples_exist_and_match(*regexps)</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="3">
- <span class="hits">7</span>
+ <li class="covered" data-hits="8" data-linenumber="3">
+ <span class="hits">8</span>
<code class="ruby"> regexps.each do |regexp|</code>
</li>
- <li class="covered" data-hits="54" data-linenumber="4">
- <span class="hits">54</span>
+ <li class="covered" data-hits="61" data-linenumber="4">
+ <span class="hits">61</span>
<code class="ruby"> it do</code>
</li>
- <li class="covered" data-hits="54" data-linenumber="5">
- <span class="hits">54</span>
+ <li class="covered" data-hits="61" data-linenumber="5">
+ <span class="hits">61</span>
<code class="ruby"> regexp_examples = regexp.examples</code>
</li>
- <li class="covered" data-hits="54" data-linenumber="6">
- <span class="hits">54</span>
+ <li class="covered" data-hits="61" data-linenumber="6">
+ <span class="hits">61</span>
<code class="ruby"> expect(regexp_examples).not_to be_empty</code>
</li>
- <li class="covered" data-hits="202" data-linenumber="7">
- <span class="hits">202</span>
+ <li class="covered" data-hits="218" data-linenumber="7">
+ <span class="hits">218</span>
<code class="ruby"> regexp_examples.each { |example| expect(example).to match(/\A(?:#{regexp.source})\z/) }</code>
</li>
<li class="never" data-hits="" data-linenumber="8">
@@ -3637,553 +3685,625 @@
</li>
<li class="never" data-hits="" data-linenumber="33">
- <code class="ruby"> /a{1,2}/</code>
+ <code class="ruby"> /a{,2}/,</code>
</li>
<li class="never" data-hits="" data-linenumber="34">
- <code class="ruby"> )</code>
+ <code class="ruby"> /a{1,2}/</code>
</li>
<li class="never" data-hits="" data-linenumber="35">
- <code class="ruby"> end</code>
+ <code class="ruby"> )</code>
</li>
<li class="never" data-hits="" data-linenumber="36">
+ <code class="ruby"> end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="37">
+
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="37">
+ <li class="covered" data-hits="1" data-linenumber="38">
<span class="hits">1</span>
<code class="ruby"> context "for basic groups" do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="38">
+ <li class="covered" data-hits="1" data-linenumber="39">
<span class="hits">1</span>
<code class="ruby"> examples_exist_and_match(</code>
</li>
- <li class="never" data-hits="" data-linenumber="39">
+ <li class="never" data-hits="" data-linenumber="40">
<code class="ruby"> /[a]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="40">
+ <li class="never" data-hits="" data-linenumber="41">
<code class="ruby"> /(a)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="41">
+ <li class="never" data-hits="" data-linenumber="42">
<code class="ruby"> /a|b/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="42">
+ <li class="never" data-hits="" data-linenumber="43">
<code class="ruby"> /./</code>
</li>
- <li class="never" data-hits="" data-linenumber="43">
+ <li class="never" data-hits="" data-linenumber="44">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="44">
+ <li class="never" data-hits="" data-linenumber="45">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="45">
+ <li class="never" data-hits="" data-linenumber="46">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="46">
+ <li class="covered" data-hits="1" data-linenumber="47">
<span class="hits">1</span>
<code class="ruby"> context "for complex char groups (square brackets)" do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="47">
+ <li class="covered" data-hits="1" data-linenumber="48">
<span class="hits">1</span>
<code class="ruby"> examples_exist_and_match(</code>
</li>
- <li class="never" data-hits="" data-linenumber="48">
+ <li class="never" data-hits="" data-linenumber="49">
<code class="ruby"> /[abc]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="49">
+ <li class="never" data-hits="" data-linenumber="50">
<code class="ruby"> /[a-c]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="50">
+ <li class="never" data-hits="" data-linenumber="51">
<code class="ruby"> /[abc-e]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="51">
+ <li class="never" data-hits="" data-linenumber="52">
<code class="ruby"> /[^a-zA-Z]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="52">
+ <li class="never" data-hits="" data-linenumber="53">
<code class="ruby"> /[\w]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="53">
+ <li class="never" data-hits="" data-linenumber="54">
<code class="ruby"> /[]]/, # TODO: How to suppress annoying warnings on this test?</code>
</li>
- <li class="never" data-hits="" data-linenumber="54">
+ <li class="never" data-hits="" data-linenumber="55">
<code class="ruby"> /[\]]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="55">
+ <li class="never" data-hits="" data-linenumber="56">
<code class="ruby"> /[\\]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="56">
+ <li class="never" data-hits="" data-linenumber="57">
<code class="ruby"> /[\\\]]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="57">
+ <li class="never" data-hits="" data-linenumber="58">
<code class="ruby"> /[\n-\r]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="58">
+ <li class="never" data-hits="" data-linenumber="59">
<code class="ruby"> /[\-]/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="59">
+ <li class="never" data-hits="" data-linenumber="60">
<code class="ruby"> /[%-+]/ # This regex is "supposed to" match some surprising things!!!</code>
</li>
- <li class="never" data-hits="" data-linenumber="60">
+ <li class="never" data-hits="" data-linenumber="61">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="61">
+ <li class="never" data-hits="" data-linenumber="62">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="62">
+ <li class="never" data-hits="" data-linenumber="63">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="63">
+ <li class="covered" data-hits="1" data-linenumber="64">
<span class="hits">1</span>
<code class="ruby"> context "for complex multi groups" do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="64">
+ <li class="covered" data-hits="1" data-linenumber="65">
<span class="hits">1</span>
<code class="ruby"> examples_exist_and_match(</code>
</li>
- <li class="never" data-hits="" data-linenumber="65">
+ <li class="never" data-hits="" data-linenumber="66">
<code class="ruby"> /(normal)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="66">
+ <li class="never" data-hits="" data-linenumber="67">
<code class="ruby"> /(?:nocapture)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="67">
+ <li class="never" data-hits="" data-linenumber="68">
<code class="ruby"> /(?<name>namedgroup)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="68">
+ <li class="never" data-hits="" data-linenumber="69">
<code class="ruby"> /(?<name>namedgroup) \k<name>/</code>
</li>
- <li class="never" data-hits="" data-linenumber="69">
+ <li class="never" data-hits="" data-linenumber="70">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="70">
+ <li class="never" data-hits="" data-linenumber="71">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="71">
+ <li class="never" data-hits="" data-linenumber="72">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="72">
+ <li class="covered" data-hits="1" data-linenumber="73">
<span class="hits">1</span>
<code class="ruby"> context "for escaped characters" do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="73">
+ <li class="covered" data-hits="1" data-linenumber="74">
<span class="hits">1</span>
<code class="ruby"> examples_exist_and_match(</code>
</li>
- <li class="never" data-hits="" data-linenumber="74">
+ <li class="never" data-hits="" data-linenumber="75">
<code class="ruby"> /\w/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="75">
+ <li class="never" data-hits="" data-linenumber="76">
<code class="ruby"> /\W/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="76">
+ <li class="never" data-hits="" data-linenumber="77">
<code class="ruby"> /\s/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="77">
+ <li class="never" data-hits="" data-linenumber="78">
<code class="ruby"> /\S/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="78">
+ <li class="never" data-hits="" data-linenumber="79">
<code class="ruby"> /\d/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="79">
+ <li class="never" data-hits="" data-linenumber="80">
<code class="ruby"> /\D/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="80">
+ <li class="never" data-hits="" data-linenumber="81">
<code class="ruby"> /\h/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="81">
+ <li class="never" data-hits="" data-linenumber="82">
<code class="ruby"> /\H/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="82">
+ <li class="never" data-hits="" data-linenumber="83">
<code class="ruby"> /\t/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="83">
+ <li class="never" data-hits="" data-linenumber="84">
<code class="ruby"> /\n/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="84">
+ <li class="never" data-hits="" data-linenumber="85">
<code class="ruby"> /\f/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="85">
+ <li class="never" data-hits="" data-linenumber="86">
<code class="ruby"> /\a/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="86">
+ <li class="never" data-hits="" data-linenumber="87">
<code class="ruby"> /\v/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="87">
+ <li class="never" data-hits="" data-linenumber="88">
<code class="ruby"> /\e/</code>
</li>
- <li class="never" data-hits="" data-linenumber="88">
+ <li class="never" data-hits="" data-linenumber="89">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="89">
+ <li class="never" data-hits="" data-linenumber="90">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="90">
+ <li class="never" data-hits="" data-linenumber="91">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="91">
+ <li class="covered" data-hits="1" data-linenumber="92">
<span class="hits">1</span>
<code class="ruby"> context "for backreferences" do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="92">
+ <li class="covered" data-hits="1" data-linenumber="93">
<span class="hits">1</span>
<code class="ruby"> examples_exist_and_match(</code>
</li>
- <li class="never" data-hits="" data-linenumber="93">
+ <li class="never" data-hits="" data-linenumber="94">
<code class="ruby"> /(repeat) \1/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="94">
+ <li class="never" data-hits="" data-linenumber="95">
<code class="ruby"> /(ref1) (ref2) \1 \2/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="95">
+ <li class="never" data-hits="" data-linenumber="96">
<code class="ruby"> /((ref2)ref1) \1 \2/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="96">
+ <li class="never" data-hits="" data-linenumber="97">
<code class="ruby"> /((ref1and2)) \1 \2/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="97">
+ <li class="never" data-hits="" data-linenumber="98">
<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="98">
+ <li class="never" data-hits="" data-linenumber="99">
<code class="ruby"> /(a?(b?(c?(d?(e?)))))/</code>
</li>
- <li class="never" data-hits="" data-linenumber="99">
+ <li class="never" data-hits="" data-linenumber="100">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="100">
+ <li class="never" data-hits="" data-linenumber="101">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="101">
+ <li class="never" data-hits="" data-linenumber="102">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="102">
+ <li class="covered" data-hits="1" data-linenumber="103">
<span class="hits">1</span>
<code class="ruby"> context "for complex patterns" do</code>
</li>
- <li class="never" data-hits="" data-linenumber="103">
+ <li class="never" data-hits="" data-linenumber="104">
<code class="ruby"> # Longer combinations of the above</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="104">
+ <li class="covered" data-hits="1" data-linenumber="105">
<span class="hits">1</span>
<code class="ruby"> examples_exist_and_match(</code>
</li>
- <li class="never" data-hits="" data-linenumber="105">
+ <li class="never" data-hits="" data-linenumber="106">
<code class="ruby"> /https?:\/\/(www\.)github\.com/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="106">
+ <li class="never" data-hits="" data-linenumber="107">
<code class="ruby"> /(I(N(C(E(P(T(I(O(N)))))))))*/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="107">
+ <li class="never" data-hits="" data-linenumber="108">
<code class="ruby"> /[\w]{1}/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="108">
+ <li class="never" data-hits="" data-linenumber="109">
<code class="ruby"> /((a?b*c+)) \1/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="109">
+ <li class="never" data-hits="" data-linenumber="110">
<code class="ruby"> /((a?b*c+)?) \1/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="110">
+ <li class="never" data-hits="" data-linenumber="111">
<code class="ruby"> /a|b|c|d/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="111">
+ <li class="never" data-hits="" data-linenumber="112">
<code class="ruby"> /a+|b*|c?/</code>
</li>
- <li class="never" data-hits="" data-linenumber="112">
+ <li class="never" data-hits="" data-linenumber="113">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="113">
+ <li class="never" data-hits="" data-linenumber="114">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="114">
+ <li class="never" data-hits="" data-linenumber="115">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="115">
+ <li class="covered" data-hits="1" data-linenumber="116">
<span class="hits">1</span>
<code class="ruby"> context "for illegal syntax" do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="116">
+ <li class="covered" data-hits="1" data-linenumber="117">
<span class="hits">1</span>
<code class="ruby"> examples_raise_illegal_syntax_error(</code>
</li>
- <li class="never" data-hits="" data-linenumber="117">
+ <li class="never" data-hits="" data-linenumber="118">
<code class="ruby"> /(?=lookahead)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="118">
+ <li class="never" data-hits="" data-linenumber="119">
<code class="ruby"> /(?!neglookahead)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="119">
+ <li class="never" data-hits="" data-linenumber="120">
<code class="ruby"> /(?<=lookbehind)/,</code>
</li>
- <li class="never" data-hits="" data-linenumber="120">
+ <li class="never" data-hits="" data-linenumber="121">
<code class="ruby"> /(?<!neglookbehind)/</code>
</li>
- <li class="never" data-hits="" data-linenumber="121">
+ <li class="never" data-hits="" data-linenumber="122">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="122">
+ <li class="never" data-hits="" data-linenumber="123">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="123">
+ <li class="never" data-hits="" data-linenumber="124">
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="125">
+ <span class="hits">1</span>
+
+ <code class="ruby"> context "for control characters" do</code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="126">
+ <span class="hits">1</span>
+
+ <code class="ruby"> examples_exist_and_match(</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="127">
+
+
+ <code class="ruby"> /\ca/,</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="128">
+
+
+ <code class="ruby"> /\cZ/,</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="129">
+
+
+ <code class="ruby"> /\c9/,</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="130">
+
+
+ <code class="ruby"> /\c[/,</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="131">
+
+
+ <code class="ruby"> /\c#/,</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="132">
+
+
+ <code class="ruby"> /\c?/</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="133">
+
+
+ <code class="ruby"> )</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="134">
+
+
+ <code class="ruby"> end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="135">
+
+
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="124">
+ <li class="never" data-hits="" data-linenumber="136">
<code class="ruby">end</code>
</li>