re2 2.23.0-arm-linux-gnu → 2.24.0-arm-linux-gnu
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/dependencies.yml +2 -2
- data/ext/re2/extconf.rb +1 -1
- data/ext/re2/re2.cc +188 -124
- data/lib/3.1/re2.so +0 -0
- data/lib/3.2/re2.so +0 -0
- data/lib/3.3/re2.so +0 -0
- data/lib/3.4/re2.so +0 -0
- data/lib/4.0/re2.so +0 -0
- data/lib/re2/version.rb +1 -1
- data/spec/re2/match_data_spec.rb +97 -0
- data/spec/re2/regexp_spec.rb +175 -0
- data/spec/re2/scanner_spec.rb +66 -0
- data/spec/re2/set_spec.rb +36 -0
- metadata +1 -1
data/spec/re2/set_spec.rb
CHANGED
|
@@ -51,6 +51,18 @@ RSpec.describe RE2::Set do
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
describe "#dup" do
|
|
55
|
+
it "raises a TypeError" do
|
|
56
|
+
expect { described_class.new.dup }.to raise_error(TypeError, /cannot copy RE2::Set/)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe "#clone" do
|
|
61
|
+
it "raises a TypeError" do
|
|
62
|
+
expect { described_class.new.clone }.to raise_error(TypeError, /cannot copy RE2::Set/)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
54
66
|
describe "#add" do
|
|
55
67
|
it "allows multiple patterns to be added", :aggregate_failures do
|
|
56
68
|
set = RE2::Set.new
|
|
@@ -93,6 +105,10 @@ RSpec.describe RE2::Set do
|
|
|
93
105
|
|
|
94
106
|
expect(set.add(StringLike.new("abc"))).to eq(0)
|
|
95
107
|
end
|
|
108
|
+
|
|
109
|
+
it "raises an error when called on an uninitialized object" do
|
|
110
|
+
expect { described_class.allocate.add("foo") }.to raise_error(TypeError, /uninitialized RE2::Set/)
|
|
111
|
+
end
|
|
96
112
|
end
|
|
97
113
|
|
|
98
114
|
describe "#compile" do
|
|
@@ -104,6 +120,10 @@ RSpec.describe RE2::Set do
|
|
|
104
120
|
|
|
105
121
|
expect(set.compile).to be_truthy
|
|
106
122
|
end
|
|
123
|
+
|
|
124
|
+
it "raises an error when called on an uninitialized object" do
|
|
125
|
+
expect { described_class.allocate.compile }.to raise_error(TypeError, /uninitialized RE2::Set/)
|
|
126
|
+
end
|
|
107
127
|
end
|
|
108
128
|
|
|
109
129
|
describe "#match" do
|
|
@@ -202,6 +222,10 @@ RSpec.describe RE2::Set do
|
|
|
202
222
|
|
|
203
223
|
expect(set.match(StringLike.new("abcdef"), exception: false)).to contain_exactly(0)
|
|
204
224
|
end
|
|
225
|
+
|
|
226
|
+
it "raises an error when called on an uninitialized object" do
|
|
227
|
+
expect { described_class.allocate.match("foo") }.to raise_error(TypeError, /uninitialized RE2::Set/)
|
|
228
|
+
end
|
|
205
229
|
end
|
|
206
230
|
|
|
207
231
|
describe "#size" do
|
|
@@ -228,6 +252,12 @@ RSpec.describe RE2::Set do
|
|
|
228
252
|
|
|
229
253
|
expect { set.size }.to raise_error(RE2::Set::UnsupportedError)
|
|
230
254
|
end
|
|
255
|
+
|
|
256
|
+
it "raises an error when called on an uninitialized object" do
|
|
257
|
+
skip "Underlying RE2::Set has no Size method" unless RE2::Set.size?
|
|
258
|
+
|
|
259
|
+
expect { described_class.allocate.size }.to raise_error(TypeError, /uninitialized RE2::Set/)
|
|
260
|
+
end
|
|
231
261
|
end
|
|
232
262
|
|
|
233
263
|
describe "#length" do
|
|
@@ -246,6 +276,12 @@ RSpec.describe RE2::Set do
|
|
|
246
276
|
|
|
247
277
|
expect(set.length).to eq(2)
|
|
248
278
|
end
|
|
279
|
+
|
|
280
|
+
it "raises an error when called on an uninitialized object" do
|
|
281
|
+
skip "Underlying RE2::Set has no Size method" unless RE2::Set.size?
|
|
282
|
+
|
|
283
|
+
expect { described_class.allocate.length }.to raise_error(TypeError, /uninitialized RE2::Set/)
|
|
284
|
+
end
|
|
249
285
|
end
|
|
250
286
|
|
|
251
287
|
def silence_stderr
|