ruby-marc-spec 0.1.0
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 +7 -0
- data/.github/workflows/build.yml +18 -0
- data/.gitignore +388 -0
- data/.gitmodules +3 -0
- data/.idea/codeStyles/codeStyleConfig.xml +5 -0
- data/.idea/go.imports.xml +6 -0
- data/.idea/inspectionProfiles/Project_Default.xml +23 -0
- data/.idea/marc_spec.iml +102 -0
- data/.idea/misc.xml +6 -0
- data/.idea/modules.xml +8 -0
- data/.idea/templateLanguages.xml +6 -0
- data/.idea/vcs.xml +7 -0
- data/.rubocop.yml +269 -0
- data/.ruby-version +1 -0
- data/.simplecov +8 -0
- data/CHANGES.md +3 -0
- data/Gemfile +6 -0
- data/LICENSE.md +21 -0
- data/README.md +172 -0
- data/Rakefile +20 -0
- data/lib/.rubocop.yml +5 -0
- data/lib/marc/spec/module_info.rb +14 -0
- data/lib/marc/spec/parsing/closed_int_range.rb +28 -0
- data/lib/marc/spec/parsing/closed_lc_alpha_range.rb +28 -0
- data/lib/marc/spec/parsing/parser.rb +213 -0
- data/lib/marc/spec/parsing.rb +1 -0
- data/lib/marc/spec/queries/al_num_range.rb +105 -0
- data/lib/marc/spec/queries/applicable.rb +18 -0
- data/lib/marc/spec/queries/character_spec.rb +81 -0
- data/lib/marc/spec/queries/comparison_string.rb +45 -0
- data/lib/marc/spec/queries/condition.rb +133 -0
- data/lib/marc/spec/queries/condition_context.rb +49 -0
- data/lib/marc/spec/queries/dsl.rb +80 -0
- data/lib/marc/spec/queries/indicator_value.rb +77 -0
- data/lib/marc/spec/queries/operator.rb +129 -0
- data/lib/marc/spec/queries/part.rb +63 -0
- data/lib/marc/spec/queries/position.rb +59 -0
- data/lib/marc/spec/queries/position_or_range.rb +27 -0
- data/lib/marc/spec/queries/query.rb +94 -0
- data/lib/marc/spec/queries/query_executor.rb +52 -0
- data/lib/marc/spec/queries/selector.rb +12 -0
- data/lib/marc/spec/queries/subfield.rb +88 -0
- data/lib/marc/spec/queries/subfield_value.rb +63 -0
- data/lib/marc/spec/queries/tag.rb +107 -0
- data/lib/marc/spec/queries/transform.rb +154 -0
- data/lib/marc/spec/queries.rb +1 -0
- data/lib/marc/spec.rb +32 -0
- data/rakelib/.rubocop.yml +19 -0
- data/rakelib/bundle.rake +8 -0
- data/rakelib/coverage.rake +11 -0
- data/rakelib/gem.rake +54 -0
- data/rakelib/parser_specs/formatter.rb +31 -0
- data/rakelib/parser_specs/parser_specs.rb.txt.erb +35 -0
- data/rakelib/parser_specs/rule.rb +95 -0
- data/rakelib/parser_specs/suite.rb +91 -0
- data/rakelib/parser_specs/test.rb +97 -0
- data/rakelib/parser_specs.rb +1 -0
- data/rakelib/rubocop.rake +18 -0
- data/rakelib/spec.rake +27 -0
- data/ruby-marc-spec.gemspec +42 -0
- data/spec/.rubocop.yml +46 -0
- data/spec/README.md +16 -0
- data/spec/data/b23161018-sru.xml +182 -0
- data/spec/data/sandburg.xml +82 -0
- data/spec/generated/char_indicator_spec.rb +174 -0
- data/spec/generated/char_spec.rb +113 -0
- data/spec/generated/comparison_string_spec.rb +74 -0
- data/spec/generated/field_tag_spec.rb +156 -0
- data/spec/generated/index_char_spec.rb +669 -0
- data/spec/generated/index_indicator_spec.rb +174 -0
- data/spec/generated/index_spec.rb +113 -0
- data/spec/generated/index_sub_spec_spec.rb +1087 -0
- data/spec/generated/indicators_spec.rb +75 -0
- data/spec/generated/position_or_range_spec.rb +110 -0
- data/spec/generated/sub_spec_spec.rb +208 -0
- data/spec/generated/sub_spec_sub_spec_spec.rb +1829 -0
- data/spec/generated/subfield_char_spec.rb +405 -0
- data/spec/generated/subfield_range_range_spec.rb +48 -0
- data/spec/generated/subfield_range_spec.rb +87 -0
- data/spec/generated/subfield_range_sub_spec_spec.rb +214 -0
- data/spec/generated/subfield_tag_range_spec.rb +477 -0
- data/spec/generated/subfield_tag_sub_spec_spec.rb +3216 -0
- data/spec/generated/subfield_tag_tag_spec.rb +5592 -0
- data/spec/marc/spec/parsing/closed_int_range_spec.rb +49 -0
- data/spec/marc/spec/parsing/closed_lc_alpha_range_spec.rb +49 -0
- data/spec/marc/spec/parsing/parser_spec.rb +545 -0
- data/spec/marc/spec/queries/al_num_range_spec.rb +114 -0
- data/spec/marc/spec/queries/character_spec_spec.rb +28 -0
- data/spec/marc/spec/queries/comparison_string_spec.rb +28 -0
- data/spec/marc/spec/queries/indicator_value_spec.rb +28 -0
- data/spec/marc/spec/queries/query_spec.rb +200 -0
- data/spec/marc/spec/queries/subfield_spec.rb +92 -0
- data/spec/marc/spec/queries/subfield_value_spec.rb +31 -0
- data/spec/marc/spec/queries/tag_spec.rb +144 -0
- data/spec/marc/spec/queries/transform_spec.rb +459 -0
- data/spec/marc_spec_spec.rb +247 -0
- data/spec/scratch_spec.rb +112 -0
- data/spec/spec_helper.rb +23 -0
- metadata +341 -0
@@ -0,0 +1,669 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'parslet/rig/rspec'
|
3
|
+
|
4
|
+
module MARC
|
5
|
+
module Spec
|
6
|
+
module Parsing
|
7
|
+
context 'suite' do
|
8
|
+
describe :index_char do
|
9
|
+
let(:parser) { Parser.new }
|
10
|
+
let(:reporter) { Parslet::ErrorReporter::Deepest.new }
|
11
|
+
|
12
|
+
describe 'marc_spec: valid field tag, index and charspec' do
|
13
|
+
# /valid/wildCombination_validIndexChar.json
|
14
|
+
|
15
|
+
describe 'last position' do
|
16
|
+
|
17
|
+
it '&& first position -> valid' do
|
18
|
+
# /valid/wildCombination_validIndexChar.json
|
19
|
+
expect(parser.marc_spec).to parse('...[#]/0', trace: true, reporter: reporter)
|
20
|
+
end
|
21
|
+
|
22
|
+
it '&& last position -> valid' do
|
23
|
+
# /valid/wildCombination_validIndexChar.json
|
24
|
+
expect(parser.marc_spec).to parse('...[#]/#', trace: true, reporter: reporter)
|
25
|
+
end
|
26
|
+
|
27
|
+
it '&& position 101 -> valid' do
|
28
|
+
# /valid/wildCombination_validIndexChar.json
|
29
|
+
expect(parser.marc_spec).to parse('...[#]/100', trace: true, reporter: reporter)
|
30
|
+
end
|
31
|
+
|
32
|
+
it '&& position eleven -> valid' do
|
33
|
+
# /valid/wildCombination_validIndexChar.json
|
34
|
+
expect(parser.marc_spec).to parse('...[#]/10', trace: true, reporter: reporter)
|
35
|
+
end
|
36
|
+
|
37
|
+
it '&& position ten -> valid' do
|
38
|
+
# /valid/wildCombination_validIndexChar.json
|
39
|
+
expect(parser.marc_spec).to parse('...[#]/9', trace: true, reporter: reporter)
|
40
|
+
end
|
41
|
+
|
42
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
43
|
+
# /valid/wildCombination_validIndexChar.json
|
44
|
+
expect(parser.marc_spec).to parse('...[#]/0-0', trace: true, reporter: reporter)
|
45
|
+
end
|
46
|
+
|
47
|
+
it '&& range from first position to last -> valid' do
|
48
|
+
# /valid/wildCombination_validIndexChar.json
|
49
|
+
expect(parser.marc_spec).to parse('...[#]/0-#', trace: true, reporter: reporter)
|
50
|
+
end
|
51
|
+
|
52
|
+
it '&& range from first position to second -> valid' do
|
53
|
+
# /valid/wildCombination_validIndexChar.json
|
54
|
+
expect(parser.marc_spec).to parse('...[#]/0-1', trace: true, reporter: reporter)
|
55
|
+
end
|
56
|
+
|
57
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
58
|
+
# /valid/wildCombination_validIndexChar.json
|
59
|
+
expect(parser.marc_spec).to parse('...[#]/#-#', trace: true, reporter: reporter)
|
60
|
+
end
|
61
|
+
|
62
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
63
|
+
# /valid/wildCombination_validIndexChar.json
|
64
|
+
expect(parser.marc_spec).to parse('...[#]/#-0', trace: true, reporter: reporter)
|
65
|
+
end
|
66
|
+
|
67
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
68
|
+
# /valid/wildCombination_validIndexChar.json
|
69
|
+
expect(parser.marc_spec).to parse('...[#]/#-1', trace: true, reporter: reporter)
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
describe 'first position' do
|
75
|
+
|
76
|
+
it '&& first position -> valid' do
|
77
|
+
# /valid/wildCombination_validIndexChar.json
|
78
|
+
expect(parser.marc_spec).to parse('...[0]/0', trace: true, reporter: reporter)
|
79
|
+
end
|
80
|
+
|
81
|
+
it '&& last position -> valid' do
|
82
|
+
# /valid/wildCombination_validIndexChar.json
|
83
|
+
expect(parser.marc_spec).to parse('...[0]/#', trace: true, reporter: reporter)
|
84
|
+
end
|
85
|
+
|
86
|
+
it '&& position 101 -> valid' do
|
87
|
+
# /valid/wildCombination_validIndexChar.json
|
88
|
+
expect(parser.marc_spec).to parse('...[0]/100', trace: true, reporter: reporter)
|
89
|
+
end
|
90
|
+
|
91
|
+
it '&& position eleven -> valid' do
|
92
|
+
# /valid/wildCombination_validIndexChar.json
|
93
|
+
expect(parser.marc_spec).to parse('...[0]/10', trace: true, reporter: reporter)
|
94
|
+
end
|
95
|
+
|
96
|
+
it '&& position ten -> valid' do
|
97
|
+
# /valid/wildCombination_validIndexChar.json
|
98
|
+
expect(parser.marc_spec).to parse('...[0]/9', trace: true, reporter: reporter)
|
99
|
+
end
|
100
|
+
|
101
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
102
|
+
# /valid/wildCombination_validIndexChar.json
|
103
|
+
expect(parser.marc_spec).to parse('...[0]/0-0', trace: true, reporter: reporter)
|
104
|
+
end
|
105
|
+
|
106
|
+
it '&& range from first position to last -> valid' do
|
107
|
+
# /valid/wildCombination_validIndexChar.json
|
108
|
+
expect(parser.marc_spec).to parse('...[0]/0-#', trace: true, reporter: reporter)
|
109
|
+
end
|
110
|
+
|
111
|
+
it '&& range from first position to second -> valid' do
|
112
|
+
# /valid/wildCombination_validIndexChar.json
|
113
|
+
expect(parser.marc_spec).to parse('...[0]/0-1', trace: true, reporter: reporter)
|
114
|
+
end
|
115
|
+
|
116
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
117
|
+
# /valid/wildCombination_validIndexChar.json
|
118
|
+
expect(parser.marc_spec).to parse('...[0]/#-#', trace: true, reporter: reporter)
|
119
|
+
end
|
120
|
+
|
121
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
122
|
+
# /valid/wildCombination_validIndexChar.json
|
123
|
+
expect(parser.marc_spec).to parse('...[0]/#-0', trace: true, reporter: reporter)
|
124
|
+
end
|
125
|
+
|
126
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
127
|
+
# /valid/wildCombination_validIndexChar.json
|
128
|
+
expect(parser.marc_spec).to parse('...[0]/#-1', trace: true, reporter: reporter)
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
describe 'position ten' do
|
134
|
+
|
135
|
+
it '&& first position -> valid' do
|
136
|
+
# /valid/wildCombination_validIndexChar.json
|
137
|
+
expect(parser.marc_spec).to parse('...[9]/0', trace: true, reporter: reporter)
|
138
|
+
end
|
139
|
+
|
140
|
+
it '&& last position -> valid' do
|
141
|
+
# /valid/wildCombination_validIndexChar.json
|
142
|
+
expect(parser.marc_spec).to parse('...[9]/#', trace: true, reporter: reporter)
|
143
|
+
end
|
144
|
+
|
145
|
+
it '&& position 101 -> valid' do
|
146
|
+
# /valid/wildCombination_validIndexChar.json
|
147
|
+
expect(parser.marc_spec).to parse('...[9]/100', trace: true, reporter: reporter)
|
148
|
+
end
|
149
|
+
|
150
|
+
it '&& position eleven -> valid' do
|
151
|
+
# /valid/wildCombination_validIndexChar.json
|
152
|
+
expect(parser.marc_spec).to parse('...[9]/10', trace: true, reporter: reporter)
|
153
|
+
end
|
154
|
+
|
155
|
+
it '&& position ten -> valid' do
|
156
|
+
# /valid/wildCombination_validIndexChar.json
|
157
|
+
expect(parser.marc_spec).to parse('...[9]/9', trace: true, reporter: reporter)
|
158
|
+
end
|
159
|
+
|
160
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
161
|
+
# /valid/wildCombination_validIndexChar.json
|
162
|
+
expect(parser.marc_spec).to parse('...[9]/0-0', trace: true, reporter: reporter)
|
163
|
+
end
|
164
|
+
|
165
|
+
it '&& range from first position to last -> valid' do
|
166
|
+
# /valid/wildCombination_validIndexChar.json
|
167
|
+
expect(parser.marc_spec).to parse('...[9]/0-#', trace: true, reporter: reporter)
|
168
|
+
end
|
169
|
+
|
170
|
+
it '&& range from first position to second -> valid' do
|
171
|
+
# /valid/wildCombination_validIndexChar.json
|
172
|
+
expect(parser.marc_spec).to parse('...[9]/0-1', trace: true, reporter: reporter)
|
173
|
+
end
|
174
|
+
|
175
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
176
|
+
# /valid/wildCombination_validIndexChar.json
|
177
|
+
expect(parser.marc_spec).to parse('...[9]/#-#', trace: true, reporter: reporter)
|
178
|
+
end
|
179
|
+
|
180
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
181
|
+
# /valid/wildCombination_validIndexChar.json
|
182
|
+
expect(parser.marc_spec).to parse('...[9]/#-0', trace: true, reporter: reporter)
|
183
|
+
end
|
184
|
+
|
185
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
186
|
+
# /valid/wildCombination_validIndexChar.json
|
187
|
+
expect(parser.marc_spec).to parse('...[9]/#-1', trace: true, reporter: reporter)
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
191
|
+
|
192
|
+
describe 'position eleven' do
|
193
|
+
|
194
|
+
it '&& first position -> valid' do
|
195
|
+
# /valid/wildCombination_validIndexChar.json
|
196
|
+
expect(parser.marc_spec).to parse('...[10]/0', trace: true, reporter: reporter)
|
197
|
+
end
|
198
|
+
|
199
|
+
it '&& last position -> valid' do
|
200
|
+
# /valid/wildCombination_validIndexChar.json
|
201
|
+
expect(parser.marc_spec).to parse('...[10]/#', trace: true, reporter: reporter)
|
202
|
+
end
|
203
|
+
|
204
|
+
it '&& position 101 -> valid' do
|
205
|
+
# /valid/wildCombination_validIndexChar.json
|
206
|
+
expect(parser.marc_spec).to parse('...[10]/100', trace: true, reporter: reporter)
|
207
|
+
end
|
208
|
+
|
209
|
+
it '&& position eleven -> valid' do
|
210
|
+
# /valid/wildCombination_validIndexChar.json
|
211
|
+
expect(parser.marc_spec).to parse('...[10]/10', trace: true, reporter: reporter)
|
212
|
+
end
|
213
|
+
|
214
|
+
it '&& position ten -> valid' do
|
215
|
+
# /valid/wildCombination_validIndexChar.json
|
216
|
+
expect(parser.marc_spec).to parse('...[10]/9', trace: true, reporter: reporter)
|
217
|
+
end
|
218
|
+
|
219
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
220
|
+
# /valid/wildCombination_validIndexChar.json
|
221
|
+
expect(parser.marc_spec).to parse('...[10]/0-0', trace: true, reporter: reporter)
|
222
|
+
end
|
223
|
+
|
224
|
+
it '&& range from first position to last -> valid' do
|
225
|
+
# /valid/wildCombination_validIndexChar.json
|
226
|
+
expect(parser.marc_spec).to parse('...[10]/0-#', trace: true, reporter: reporter)
|
227
|
+
end
|
228
|
+
|
229
|
+
it '&& range from first position to second -> valid' do
|
230
|
+
# /valid/wildCombination_validIndexChar.json
|
231
|
+
expect(parser.marc_spec).to parse('...[10]/0-1', trace: true, reporter: reporter)
|
232
|
+
end
|
233
|
+
|
234
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
235
|
+
# /valid/wildCombination_validIndexChar.json
|
236
|
+
expect(parser.marc_spec).to parse('...[10]/#-#', trace: true, reporter: reporter)
|
237
|
+
end
|
238
|
+
|
239
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
240
|
+
# /valid/wildCombination_validIndexChar.json
|
241
|
+
expect(parser.marc_spec).to parse('...[10]/#-0', trace: true, reporter: reporter)
|
242
|
+
end
|
243
|
+
|
244
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
245
|
+
# /valid/wildCombination_validIndexChar.json
|
246
|
+
expect(parser.marc_spec).to parse('...[10]/#-1', trace: true, reporter: reporter)
|
247
|
+
end
|
248
|
+
|
249
|
+
end
|
250
|
+
|
251
|
+
describe 'position 101' do
|
252
|
+
|
253
|
+
it '&& first position -> valid' do
|
254
|
+
# /valid/wildCombination_validIndexChar.json
|
255
|
+
expect(parser.marc_spec).to parse('...[100]/0', trace: true, reporter: reporter)
|
256
|
+
end
|
257
|
+
|
258
|
+
it '&& last position -> valid' do
|
259
|
+
# /valid/wildCombination_validIndexChar.json
|
260
|
+
expect(parser.marc_spec).to parse('...[100]/#', trace: true, reporter: reporter)
|
261
|
+
end
|
262
|
+
|
263
|
+
it '&& position 101 -> valid' do
|
264
|
+
# /valid/wildCombination_validIndexChar.json
|
265
|
+
expect(parser.marc_spec).to parse('...[100]/100', trace: true, reporter: reporter)
|
266
|
+
end
|
267
|
+
|
268
|
+
it '&& position eleven -> valid' do
|
269
|
+
# /valid/wildCombination_validIndexChar.json
|
270
|
+
expect(parser.marc_spec).to parse('...[100]/10', trace: true, reporter: reporter)
|
271
|
+
end
|
272
|
+
|
273
|
+
it '&& position ten -> valid' do
|
274
|
+
# /valid/wildCombination_validIndexChar.json
|
275
|
+
expect(parser.marc_spec).to parse('...[100]/9', trace: true, reporter: reporter)
|
276
|
+
end
|
277
|
+
|
278
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
279
|
+
# /valid/wildCombination_validIndexChar.json
|
280
|
+
expect(parser.marc_spec).to parse('...[100]/0-0', trace: true, reporter: reporter)
|
281
|
+
end
|
282
|
+
|
283
|
+
it '&& range from first position to last -> valid' do
|
284
|
+
# /valid/wildCombination_validIndexChar.json
|
285
|
+
expect(parser.marc_spec).to parse('...[100]/0-#', trace: true, reporter: reporter)
|
286
|
+
end
|
287
|
+
|
288
|
+
it '&& range from first position to second -> valid' do
|
289
|
+
# /valid/wildCombination_validIndexChar.json
|
290
|
+
expect(parser.marc_spec).to parse('...[100]/0-1', trace: true, reporter: reporter)
|
291
|
+
end
|
292
|
+
|
293
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
294
|
+
# /valid/wildCombination_validIndexChar.json
|
295
|
+
expect(parser.marc_spec).to parse('...[100]/#-#', trace: true, reporter: reporter)
|
296
|
+
end
|
297
|
+
|
298
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
299
|
+
# /valid/wildCombination_validIndexChar.json
|
300
|
+
expect(parser.marc_spec).to parse('...[100]/#-0', trace: true, reporter: reporter)
|
301
|
+
end
|
302
|
+
|
303
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
304
|
+
# /valid/wildCombination_validIndexChar.json
|
305
|
+
expect(parser.marc_spec).to parse('...[100]/#-1', trace: true, reporter: reporter)
|
306
|
+
end
|
307
|
+
|
308
|
+
end
|
309
|
+
|
310
|
+
describe 'range from first position to second' do
|
311
|
+
|
312
|
+
it '&& first position -> valid' do
|
313
|
+
# /valid/wildCombination_validIndexChar.json
|
314
|
+
expect(parser.marc_spec).to parse('...[0-1]/0', trace: true, reporter: reporter)
|
315
|
+
end
|
316
|
+
|
317
|
+
it '&& last position -> valid' do
|
318
|
+
# /valid/wildCombination_validIndexChar.json
|
319
|
+
expect(parser.marc_spec).to parse('...[0-1]/#', trace: true, reporter: reporter)
|
320
|
+
end
|
321
|
+
|
322
|
+
it '&& position 101 -> valid' do
|
323
|
+
# /valid/wildCombination_validIndexChar.json
|
324
|
+
expect(parser.marc_spec).to parse('...[0-1]/100', trace: true, reporter: reporter)
|
325
|
+
end
|
326
|
+
|
327
|
+
it '&& position eleven -> valid' do
|
328
|
+
# /valid/wildCombination_validIndexChar.json
|
329
|
+
expect(parser.marc_spec).to parse('...[0-1]/10', trace: true, reporter: reporter)
|
330
|
+
end
|
331
|
+
|
332
|
+
it '&& position ten -> valid' do
|
333
|
+
# /valid/wildCombination_validIndexChar.json
|
334
|
+
expect(parser.marc_spec).to parse('...[0-1]/9', trace: true, reporter: reporter)
|
335
|
+
end
|
336
|
+
|
337
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
338
|
+
# /valid/wildCombination_validIndexChar.json
|
339
|
+
expect(parser.marc_spec).to parse('...[0-1]/0-0', trace: true, reporter: reporter)
|
340
|
+
end
|
341
|
+
|
342
|
+
it '&& range from first position to last -> valid' do
|
343
|
+
# /valid/wildCombination_validIndexChar.json
|
344
|
+
expect(parser.marc_spec).to parse('...[0-1]/0-#', trace: true, reporter: reporter)
|
345
|
+
end
|
346
|
+
|
347
|
+
it '&& range from first position to second -> valid' do
|
348
|
+
# /valid/wildCombination_validIndexChar.json
|
349
|
+
expect(parser.marc_spec).to parse('...[0-1]/0-1', trace: true, reporter: reporter)
|
350
|
+
end
|
351
|
+
|
352
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
353
|
+
# /valid/wildCombination_validIndexChar.json
|
354
|
+
expect(parser.marc_spec).to parse('...[0-1]/#-#', trace: true, reporter: reporter)
|
355
|
+
end
|
356
|
+
|
357
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
358
|
+
# /valid/wildCombination_validIndexChar.json
|
359
|
+
expect(parser.marc_spec).to parse('...[0-1]/#-0', trace: true, reporter: reporter)
|
360
|
+
end
|
361
|
+
|
362
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
363
|
+
# /valid/wildCombination_validIndexChar.json
|
364
|
+
expect(parser.marc_spec).to parse('...[0-1]/#-1', trace: true, reporter: reporter)
|
365
|
+
end
|
366
|
+
|
367
|
+
end
|
368
|
+
|
369
|
+
describe 'range from first position to last' do
|
370
|
+
|
371
|
+
it '&& first position -> valid' do
|
372
|
+
# /valid/wildCombination_validIndexChar.json
|
373
|
+
expect(parser.marc_spec).to parse('...[0-#]/0', trace: true, reporter: reporter)
|
374
|
+
end
|
375
|
+
|
376
|
+
it '&& last position -> valid' do
|
377
|
+
# /valid/wildCombination_validIndexChar.json
|
378
|
+
expect(parser.marc_spec).to parse('...[0-#]/#', trace: true, reporter: reporter)
|
379
|
+
end
|
380
|
+
|
381
|
+
it '&& position 101 -> valid' do
|
382
|
+
# /valid/wildCombination_validIndexChar.json
|
383
|
+
expect(parser.marc_spec).to parse('...[0-#]/100', trace: true, reporter: reporter)
|
384
|
+
end
|
385
|
+
|
386
|
+
it '&& position eleven -> valid' do
|
387
|
+
# /valid/wildCombination_validIndexChar.json
|
388
|
+
expect(parser.marc_spec).to parse('...[0-#]/10', trace: true, reporter: reporter)
|
389
|
+
end
|
390
|
+
|
391
|
+
it '&& position ten -> valid' do
|
392
|
+
# /valid/wildCombination_validIndexChar.json
|
393
|
+
expect(parser.marc_spec).to parse('...[0-#]/9', trace: true, reporter: reporter)
|
394
|
+
end
|
395
|
+
|
396
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
397
|
+
# /valid/wildCombination_validIndexChar.json
|
398
|
+
expect(parser.marc_spec).to parse('...[0-#]/0-0', trace: true, reporter: reporter)
|
399
|
+
end
|
400
|
+
|
401
|
+
it '&& range from first position to last -> valid' do
|
402
|
+
# /valid/wildCombination_validIndexChar.json
|
403
|
+
expect(parser.marc_spec).to parse('...[0-#]/0-#', trace: true, reporter: reporter)
|
404
|
+
end
|
405
|
+
|
406
|
+
it '&& range from first position to second -> valid' do
|
407
|
+
# /valid/wildCombination_validIndexChar.json
|
408
|
+
expect(parser.marc_spec).to parse('...[0-#]/0-1', trace: true, reporter: reporter)
|
409
|
+
end
|
410
|
+
|
411
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
412
|
+
# /valid/wildCombination_validIndexChar.json
|
413
|
+
expect(parser.marc_spec).to parse('...[0-#]/#-#', trace: true, reporter: reporter)
|
414
|
+
end
|
415
|
+
|
416
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
417
|
+
# /valid/wildCombination_validIndexChar.json
|
418
|
+
expect(parser.marc_spec).to parse('...[0-#]/#-0', trace: true, reporter: reporter)
|
419
|
+
end
|
420
|
+
|
421
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
422
|
+
# /valid/wildCombination_validIndexChar.json
|
423
|
+
expect(parser.marc_spec).to parse('...[0-#]/#-1', trace: true, reporter: reporter)
|
424
|
+
end
|
425
|
+
|
426
|
+
end
|
427
|
+
|
428
|
+
describe 'range from first position to first position, is like first position' do
|
429
|
+
|
430
|
+
it '&& first position -> valid' do
|
431
|
+
# /valid/wildCombination_validIndexChar.json
|
432
|
+
expect(parser.marc_spec).to parse('...[0-0]/0', trace: true, reporter: reporter)
|
433
|
+
end
|
434
|
+
|
435
|
+
it '&& last position -> valid' do
|
436
|
+
# /valid/wildCombination_validIndexChar.json
|
437
|
+
expect(parser.marc_spec).to parse('...[0-0]/#', trace: true, reporter: reporter)
|
438
|
+
end
|
439
|
+
|
440
|
+
it '&& position 101 -> valid' do
|
441
|
+
# /valid/wildCombination_validIndexChar.json
|
442
|
+
expect(parser.marc_spec).to parse('...[0-0]/100', trace: true, reporter: reporter)
|
443
|
+
end
|
444
|
+
|
445
|
+
it '&& position eleven -> valid' do
|
446
|
+
# /valid/wildCombination_validIndexChar.json
|
447
|
+
expect(parser.marc_spec).to parse('...[0-0]/10', trace: true, reporter: reporter)
|
448
|
+
end
|
449
|
+
|
450
|
+
it '&& position ten -> valid' do
|
451
|
+
# /valid/wildCombination_validIndexChar.json
|
452
|
+
expect(parser.marc_spec).to parse('...[0-0]/9', trace: true, reporter: reporter)
|
453
|
+
end
|
454
|
+
|
455
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
456
|
+
# /valid/wildCombination_validIndexChar.json
|
457
|
+
expect(parser.marc_spec).to parse('...[0-0]/0-0', trace: true, reporter: reporter)
|
458
|
+
end
|
459
|
+
|
460
|
+
it '&& range from first position to last -> valid' do
|
461
|
+
# /valid/wildCombination_validIndexChar.json
|
462
|
+
expect(parser.marc_spec).to parse('...[0-0]/0-#', trace: true, reporter: reporter)
|
463
|
+
end
|
464
|
+
|
465
|
+
it '&& range from first position to second -> valid' do
|
466
|
+
# /valid/wildCombination_validIndexChar.json
|
467
|
+
expect(parser.marc_spec).to parse('...[0-0]/0-1', trace: true, reporter: reporter)
|
468
|
+
end
|
469
|
+
|
470
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
471
|
+
# /valid/wildCombination_validIndexChar.json
|
472
|
+
expect(parser.marc_spec).to parse('...[0-0]/#-#', trace: true, reporter: reporter)
|
473
|
+
end
|
474
|
+
|
475
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
476
|
+
# /valid/wildCombination_validIndexChar.json
|
477
|
+
expect(parser.marc_spec).to parse('...[0-0]/#-0', trace: true, reporter: reporter)
|
478
|
+
end
|
479
|
+
|
480
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
481
|
+
# /valid/wildCombination_validIndexChar.json
|
482
|
+
expect(parser.marc_spec).to parse('...[0-0]/#-1', trace: true, reporter: reporter)
|
483
|
+
end
|
484
|
+
|
485
|
+
end
|
486
|
+
|
487
|
+
describe 'range from last position to last position, is like last position' do
|
488
|
+
|
489
|
+
it '&& first position -> valid' do
|
490
|
+
# /valid/wildCombination_validIndexChar.json
|
491
|
+
expect(parser.marc_spec).to parse('...[#-#]/0', trace: true, reporter: reporter)
|
492
|
+
end
|
493
|
+
|
494
|
+
it '&& last position -> valid' do
|
495
|
+
# /valid/wildCombination_validIndexChar.json
|
496
|
+
expect(parser.marc_spec).to parse('...[#-#]/#', trace: true, reporter: reporter)
|
497
|
+
end
|
498
|
+
|
499
|
+
it '&& position 101 -> valid' do
|
500
|
+
# /valid/wildCombination_validIndexChar.json
|
501
|
+
expect(parser.marc_spec).to parse('...[#-#]/100', trace: true, reporter: reporter)
|
502
|
+
end
|
503
|
+
|
504
|
+
it '&& position eleven -> valid' do
|
505
|
+
# /valid/wildCombination_validIndexChar.json
|
506
|
+
expect(parser.marc_spec).to parse('...[#-#]/10', trace: true, reporter: reporter)
|
507
|
+
end
|
508
|
+
|
509
|
+
it '&& position ten -> valid' do
|
510
|
+
# /valid/wildCombination_validIndexChar.json
|
511
|
+
expect(parser.marc_spec).to parse('...[#-#]/9', trace: true, reporter: reporter)
|
512
|
+
end
|
513
|
+
|
514
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
515
|
+
# /valid/wildCombination_validIndexChar.json
|
516
|
+
expect(parser.marc_spec).to parse('...[#-#]/0-0', trace: true, reporter: reporter)
|
517
|
+
end
|
518
|
+
|
519
|
+
it '&& range from first position to last -> valid' do
|
520
|
+
# /valid/wildCombination_validIndexChar.json
|
521
|
+
expect(parser.marc_spec).to parse('...[#-#]/0-#', trace: true, reporter: reporter)
|
522
|
+
end
|
523
|
+
|
524
|
+
it '&& range from first position to second -> valid' do
|
525
|
+
# /valid/wildCombination_validIndexChar.json
|
526
|
+
expect(parser.marc_spec).to parse('...[#-#]/0-1', trace: true, reporter: reporter)
|
527
|
+
end
|
528
|
+
|
529
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
530
|
+
# /valid/wildCombination_validIndexChar.json
|
531
|
+
expect(parser.marc_spec).to parse('...[#-#]/#-#', trace: true, reporter: reporter)
|
532
|
+
end
|
533
|
+
|
534
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
535
|
+
# /valid/wildCombination_validIndexChar.json
|
536
|
+
expect(parser.marc_spec).to parse('...[#-#]/#-0', trace: true, reporter: reporter)
|
537
|
+
end
|
538
|
+
|
539
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
540
|
+
# /valid/wildCombination_validIndexChar.json
|
541
|
+
expect(parser.marc_spec).to parse('...[#-#]/#-1', trace: true, reporter: reporter)
|
542
|
+
end
|
543
|
+
|
544
|
+
end
|
545
|
+
|
546
|
+
describe 'range from last position to position one (index reverted), is like last position' do
|
547
|
+
|
548
|
+
it '&& first position -> valid' do
|
549
|
+
# /valid/wildCombination_validIndexChar.json
|
550
|
+
expect(parser.marc_spec).to parse('...[#-0]/0', trace: true, reporter: reporter)
|
551
|
+
end
|
552
|
+
|
553
|
+
it '&& last position -> valid' do
|
554
|
+
# /valid/wildCombination_validIndexChar.json
|
555
|
+
expect(parser.marc_spec).to parse('...[#-0]/#', trace: true, reporter: reporter)
|
556
|
+
end
|
557
|
+
|
558
|
+
it '&& position 101 -> valid' do
|
559
|
+
# /valid/wildCombination_validIndexChar.json
|
560
|
+
expect(parser.marc_spec).to parse('...[#-0]/100', trace: true, reporter: reporter)
|
561
|
+
end
|
562
|
+
|
563
|
+
it '&& position eleven -> valid' do
|
564
|
+
# /valid/wildCombination_validIndexChar.json
|
565
|
+
expect(parser.marc_spec).to parse('...[#-0]/10', trace: true, reporter: reporter)
|
566
|
+
end
|
567
|
+
|
568
|
+
it '&& position ten -> valid' do
|
569
|
+
# /valid/wildCombination_validIndexChar.json
|
570
|
+
expect(parser.marc_spec).to parse('...[#-0]/9', trace: true, reporter: reporter)
|
571
|
+
end
|
572
|
+
|
573
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
574
|
+
# /valid/wildCombination_validIndexChar.json
|
575
|
+
expect(parser.marc_spec).to parse('...[#-0]/0-0', trace: true, reporter: reporter)
|
576
|
+
end
|
577
|
+
|
578
|
+
it '&& range from first position to last -> valid' do
|
579
|
+
# /valid/wildCombination_validIndexChar.json
|
580
|
+
expect(parser.marc_spec).to parse('...[#-0]/0-#', trace: true, reporter: reporter)
|
581
|
+
end
|
582
|
+
|
583
|
+
it '&& range from first position to second -> valid' do
|
584
|
+
# /valid/wildCombination_validIndexChar.json
|
585
|
+
expect(parser.marc_spec).to parse('...[#-0]/0-1', trace: true, reporter: reporter)
|
586
|
+
end
|
587
|
+
|
588
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
589
|
+
# /valid/wildCombination_validIndexChar.json
|
590
|
+
expect(parser.marc_spec).to parse('...[#-0]/#-#', trace: true, reporter: reporter)
|
591
|
+
end
|
592
|
+
|
593
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
594
|
+
# /valid/wildCombination_validIndexChar.json
|
595
|
+
expect(parser.marc_spec).to parse('...[#-0]/#-0', trace: true, reporter: reporter)
|
596
|
+
end
|
597
|
+
|
598
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
599
|
+
# /valid/wildCombination_validIndexChar.json
|
600
|
+
expect(parser.marc_spec).to parse('...[#-0]/#-1', trace: true, reporter: reporter)
|
601
|
+
end
|
602
|
+
|
603
|
+
end
|
604
|
+
|
605
|
+
describe 'range from last position to position two (index reverted)' do
|
606
|
+
|
607
|
+
it '&& first position -> valid' do
|
608
|
+
# /valid/wildCombination_validIndexChar.json
|
609
|
+
expect(parser.marc_spec).to parse('...[#-1]/0', trace: true, reporter: reporter)
|
610
|
+
end
|
611
|
+
|
612
|
+
it '&& last position -> valid' do
|
613
|
+
# /valid/wildCombination_validIndexChar.json
|
614
|
+
expect(parser.marc_spec).to parse('...[#-1]/#', trace: true, reporter: reporter)
|
615
|
+
end
|
616
|
+
|
617
|
+
it '&& position 101 -> valid' do
|
618
|
+
# /valid/wildCombination_validIndexChar.json
|
619
|
+
expect(parser.marc_spec).to parse('...[#-1]/100', trace: true, reporter: reporter)
|
620
|
+
end
|
621
|
+
|
622
|
+
it '&& position eleven -> valid' do
|
623
|
+
# /valid/wildCombination_validIndexChar.json
|
624
|
+
expect(parser.marc_spec).to parse('...[#-1]/10', trace: true, reporter: reporter)
|
625
|
+
end
|
626
|
+
|
627
|
+
it '&& position ten -> valid' do
|
628
|
+
# /valid/wildCombination_validIndexChar.json
|
629
|
+
expect(parser.marc_spec).to parse('...[#-1]/9', trace: true, reporter: reporter)
|
630
|
+
end
|
631
|
+
|
632
|
+
it '&& range from first position to first position, is like first position -> valid' do
|
633
|
+
# /valid/wildCombination_validIndexChar.json
|
634
|
+
expect(parser.marc_spec).to parse('...[#-1]/0-0', trace: true, reporter: reporter)
|
635
|
+
end
|
636
|
+
|
637
|
+
it '&& range from first position to last -> valid' do
|
638
|
+
# /valid/wildCombination_validIndexChar.json
|
639
|
+
expect(parser.marc_spec).to parse('...[#-1]/0-#', trace: true, reporter: reporter)
|
640
|
+
end
|
641
|
+
|
642
|
+
it '&& range from first position to second -> valid' do
|
643
|
+
# /valid/wildCombination_validIndexChar.json
|
644
|
+
expect(parser.marc_spec).to parse('...[#-1]/0-1', trace: true, reporter: reporter)
|
645
|
+
end
|
646
|
+
|
647
|
+
it '&& range from last position to last position, is like last position -> valid' do
|
648
|
+
# /valid/wildCombination_validIndexChar.json
|
649
|
+
expect(parser.marc_spec).to parse('...[#-1]/#-#', trace: true, reporter: reporter)
|
650
|
+
end
|
651
|
+
|
652
|
+
it '&& range from last position to position one (index reverted), is like last position -> valid' do
|
653
|
+
# /valid/wildCombination_validIndexChar.json
|
654
|
+
expect(parser.marc_spec).to parse('...[#-1]/#-0', trace: true, reporter: reporter)
|
655
|
+
end
|
656
|
+
|
657
|
+
it '&& range from last position to position two (index reverted) -> valid' do
|
658
|
+
# /valid/wildCombination_validIndexChar.json
|
659
|
+
expect(parser.marc_spec).to parse('...[#-1]/#-1', trace: true, reporter: reporter)
|
660
|
+
end
|
661
|
+
|
662
|
+
end
|
663
|
+
|
664
|
+
end
|
665
|
+
end
|
666
|
+
end
|
667
|
+
end
|
668
|
+
end
|
669
|
+
end
|