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,75 @@
|
|
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 :indicators do
|
9
|
+
let(:parser) { Parser.new }
|
10
|
+
let(:reporter) { Parslet::ErrorReporter::Deepest.new }
|
11
|
+
|
12
|
+
describe 'indicators are strings and match pattern' do
|
13
|
+
# /invalid/invalidIndicators.json
|
14
|
+
it 'empty -> invalid' do
|
15
|
+
# /invalid/invalidIndicators.json
|
16
|
+
expect(parser.indicators).not_to parse('', trace: true, reporter: reporter)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'indicator 1 -> valid' do
|
20
|
+
# /valid/validIndicators.json
|
21
|
+
expect(parser.indicators).to parse('1', trace: true, reporter: reporter)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'indicator 2 -> valid' do
|
25
|
+
# /valid/validIndicators.json
|
26
|
+
expect(parser.indicators).to parse('2', trace: true, reporter: reporter)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'not allowed character -> invalid' do
|
30
|
+
# /invalid/invalidIndicators.json
|
31
|
+
expect(parser.indicators).not_to parse('3', trace: true, reporter: reporter)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'only one character allowed -> invalid' do
|
35
|
+
# /invalid/invalidIndicators.json
|
36
|
+
expect(parser.indicators).not_to parse('12', trace: true, reporter: reporter)
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
describe 'marc_spec: valid field tag and indicator' do
|
41
|
+
# /valid/wildCombination_validIndicators.json
|
42
|
+
it 'indicator 1 -> valid' do
|
43
|
+
# /valid/wildCombination_validIndicators.json
|
44
|
+
expect(parser.marc_spec).to parse('...^1', trace: true, reporter: reporter)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'indicator 2 -> valid' do
|
48
|
+
# /valid/wildCombination_validIndicators.json
|
49
|
+
expect(parser.marc_spec).to parse('...^2', trace: true, reporter: reporter)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
describe 'marc_spec: valid field tag and invalid indicator' do
|
54
|
+
# /invalid/wildCombination_invalidIndicators.json
|
55
|
+
it 'empty -> invalid' do
|
56
|
+
# /invalid/wildCombination_invalidIndicators.json
|
57
|
+
expect(parser.marc_spec).not_to parse('...^', trace: true, reporter: reporter)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'not allowed character -> invalid' do
|
61
|
+
# /invalid/wildCombination_invalidIndicators.json
|
62
|
+
expect(parser.marc_spec).not_to parse('...^3', trace: true, reporter: reporter)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'only one character allowed -> invalid' do
|
66
|
+
# /invalid/wildCombination_invalidIndicators.json
|
67
|
+
expect(parser.marc_spec).not_to parse('...^12', trace: true, reporter: reporter)
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,110 @@
|
|
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 :position_or_range do
|
9
|
+
let(:parser) { Parser.new }
|
10
|
+
let(:reporter) { Parslet::ErrorReporter::Deepest.new }
|
11
|
+
|
12
|
+
describe 'positions or ranges are strings and match pattern' do
|
13
|
+
# /invalid/invalidPositionOrRange.json
|
14
|
+
it 'empty string -> invalid' do
|
15
|
+
# /invalid/invalidPositionOrRange.json
|
16
|
+
expect(parser.position_or_range).not_to parse('', trace: true, reporter: reporter)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'first position -> valid' do
|
20
|
+
# /valid/validPositionOrRange.json
|
21
|
+
expect(parser.position_or_range).to parse('0', trace: true, reporter: reporter)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'last position -> valid' do
|
25
|
+
# /valid/validPositionOrRange.json
|
26
|
+
expect(parser.position_or_range).to parse('#', trace: true, reporter: reporter)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'missing ending position -> invalid' do
|
30
|
+
# /invalid/invalidPositionOrRange.json
|
31
|
+
expect(parser.position_or_range).not_to parse('#-', trace: true, reporter: reporter)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'missing starting position -> invalid' do
|
35
|
+
# /invalid/invalidPositionOrRange.json
|
36
|
+
expect(parser.position_or_range).not_to parse('-2', trace: true, reporter: reporter)
|
37
|
+
end
|
38
|
+
|
39
|
+
it "only digits, one hyphen and the char '#' are allowed -> invalid" do
|
40
|
+
# /invalid/invalidPositionOrRange.json
|
41
|
+
expect(parser.position_or_range).not_to parse('1-X', trace: true, reporter: reporter)
|
42
|
+
expect(parser.position_or_range).not_to parse('?', trace: true, reporter: reporter)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'only one hyphen allwed -> invalid' do
|
46
|
+
# /invalid/invalidPositionOrRange.json
|
47
|
+
expect(parser.position_or_range).not_to parse('1-2-', trace: true, reporter: reporter)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'position 101 -> valid' do
|
51
|
+
# /valid/validPositionOrRange.json
|
52
|
+
expect(parser.position_or_range).to parse('100', trace: true, reporter: reporter)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'position eleven -> valid' do
|
56
|
+
# /valid/validPositionOrRange.json
|
57
|
+
expect(parser.position_or_range).to parse('10', trace: true, reporter: reporter)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'position ten -> valid' do
|
61
|
+
# /valid/validPositionOrRange.json
|
62
|
+
expect(parser.position_or_range).to parse('9', trace: true, reporter: reporter)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'range from first position to first position, is like first position -> valid' do
|
66
|
+
# /valid/validPositionOrRange.json
|
67
|
+
expect(parser.position_or_range).to parse('0-0', trace: true, reporter: reporter)
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'range from first position to last -> valid' do
|
71
|
+
# /valid/validPositionOrRange.json
|
72
|
+
expect(parser.position_or_range).to parse('0-#', trace: true, reporter: reporter)
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'range from first position to second -> valid' do
|
76
|
+
# /valid/validPositionOrRange.json
|
77
|
+
expect(parser.position_or_range).to parse('0-1', trace: true, reporter: reporter)
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'range from last position to last position, is like last position -> valid' do
|
81
|
+
# /valid/validPositionOrRange.json
|
82
|
+
expect(parser.position_or_range).to parse('#-#', trace: true, reporter: reporter)
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'range from last position to position one (index reverted), is like last position -> valid' do
|
86
|
+
# /valid/validPositionOrRange.json
|
87
|
+
expect(parser.position_or_range).to parse('#-0', trace: true, reporter: reporter)
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'range from last position to position two (index reverted) -> valid' do
|
91
|
+
# /valid/validPositionOrRange.json
|
92
|
+
expect(parser.position_or_range).to parse('#-1', trace: true, reporter: reporter)
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'this matches pattern, but starting position number must not be higher than ending position number -> invalid' do
|
96
|
+
# /invalid/invalidPositionOrRange.json
|
97
|
+
expect(parser.position_or_range).not_to parse('2-1', trace: true, reporter: reporter)
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'whitespace is not allowed -> invalid' do
|
101
|
+
# /invalid/invalidPositionOrRange.json
|
102
|
+
expect(parser.position_or_range).not_to parse('1- 2', trace: true, reporter: reporter)
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,208 @@
|
|
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 :sub_spec do
|
9
|
+
let(:parser) { Parser.new }
|
10
|
+
let(:reporter) { Parslet::ErrorReporter::Deepest.new }
|
11
|
+
|
12
|
+
describe 'marc_spec: valid field tag and subspec' do
|
13
|
+
# /valid/wildCombination_validSubSpec.json
|
14
|
+
it 'all digits -> valid' do
|
15
|
+
# /valid/wildCombination_validSubSpec.json
|
16
|
+
expect(parser.marc_spec).to parse('...{$a~\\Poe}', trace: true, reporter: reporter)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'all lowercase chars -> valid' do
|
20
|
+
# /valid/wildCombination_validSubSpec.json
|
21
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\{}', trace: true, reporter: reporter)
|
22
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\~}', trace: true, reporter: reporter)
|
23
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\?}', trace: true, reporter: reporter)
|
24
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\|}', trace: true, reporter: reporter)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'all uppercase chars special leader -> valid' do
|
28
|
+
# /valid/wildCombination_validSubSpec.json
|
29
|
+
expect(parser.marc_spec).to parse('...{$a!~\\Poe}', trace: true, reporter: reporter)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'all wildcards -> valid' do
|
33
|
+
# /valid/wildCombination_validSubSpec.json
|
34
|
+
expect(parser.marc_spec).to parse('...{245$a}', trace: true, reporter: reporter)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'mix one lowercase char and two digits -> valid' do
|
38
|
+
# /valid/wildCombination_validSubSpec.json
|
39
|
+
expect(parser.marc_spec).to parse('...{$a|$b|$c}', trace: true, reporter: reporter)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'mix two lowercase chars and one digit -> valid' do
|
43
|
+
# /valid/wildCombination_validSubSpec.json
|
44
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\$}', trace: true, reporter: reporter)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'one digit two wildcards right -> valid' do
|
48
|
+
# /valid/wildCombination_validSubSpec.json
|
49
|
+
expect(parser.marc_spec).to parse('...{$a!=$b}', trace: true, reporter: reporter)
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'one lowercase and two wildcards right -> valid' do
|
53
|
+
# /valid/wildCombination_validSubSpec.json
|
54
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\=}', trace: true, reporter: reporter)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'one uppercase char two wildcards right -> valid' do
|
58
|
+
# /valid/wildCombination_validSubSpec.json
|
59
|
+
expect(parser.marc_spec).to parse('...{$a|$b}{$c|$d}', trace: true, reporter: reporter)
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'one wildcard between uppercase chars -> valid' do
|
63
|
+
# /valid/wildCombination_validSubSpec.json
|
64
|
+
expect(parser.marc_spec).to parse('...{$a}{$b|$c}', trace: true, reporter: reporter)
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'one wildcard left and two lowercase chars -> valid' do
|
68
|
+
# /valid/wildCombination_validSubSpec.json
|
69
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\!}', trace: true, reporter: reporter)
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'one wildcard left two uppercase chars -> valid' do
|
73
|
+
# /valid/wildCombination_validSubSpec.json
|
74
|
+
expect(parser.marc_spec).to parse('...{$a|$b}{$c}', trace: true, reporter: reporter)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'one wildcard left with two digits -> valid' do
|
78
|
+
# /valid/wildCombination_validSubSpec.json
|
79
|
+
expect(parser.marc_spec).to parse('...{?$a}', trace: true, reporter: reporter)
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'two digits wildcard right -> valid' do
|
83
|
+
# /valid/wildCombination_validSubSpec.json
|
84
|
+
expect(parser.marc_spec).to parse('...{$a=$b}', trace: true, reporter: reporter)
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'two wildcards and one lowercase char right -> valid' do
|
88
|
+
# /valid/wildCombination_validSubSpec.json
|
89
|
+
expect(parser.marc_spec).to parse('...{$a~\\test\\}}', trace: true, reporter: reporter)
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'two wildcards left one uppercase char -> valid' do
|
93
|
+
# /valid/wildCombination_validSubSpec.json
|
94
|
+
expect(parser.marc_spec).to parse('...{/#=\\/}', trace: true, reporter: reporter)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'two wildcards left with digit -> valid' do
|
98
|
+
# /valid/wildCombination_validSubSpec.json
|
99
|
+
expect(parser.marc_spec).to parse('...{$a}', trace: true, reporter: reporter)
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'wildcard between digits -> valid' do
|
103
|
+
# /valid/wildCombination_validSubSpec.json
|
104
|
+
expect(parser.marc_spec).to parse('...{!$a}', trace: true, reporter: reporter)
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
describe 'subspecs are strings' do
|
109
|
+
# /valid/validSubSpec.json
|
110
|
+
it 'all digits -> valid' do
|
111
|
+
# /valid/validSubSpec.json
|
112
|
+
expect(parser.sub_spec).to parse('{$a~\\Poe}', trace: true, reporter: reporter)
|
113
|
+
end
|
114
|
+
|
115
|
+
it 'all lowercase chars -> valid' do
|
116
|
+
# /valid/validSubSpec.json
|
117
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\{}', trace: true, reporter: reporter)
|
118
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\~}', trace: true, reporter: reporter)
|
119
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\?}', trace: true, reporter: reporter)
|
120
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\|}', trace: true, reporter: reporter)
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'all uppercase chars special leader -> valid' do
|
124
|
+
# /valid/validSubSpec.json
|
125
|
+
expect(parser.sub_spec).to parse('{$a!~\\Poe}', trace: true, reporter: reporter)
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'all wildcards -> valid' do
|
129
|
+
# /valid/validSubSpec.json
|
130
|
+
expect(parser.sub_spec).to parse('{245$a}', trace: true, reporter: reporter)
|
131
|
+
end
|
132
|
+
|
133
|
+
it 'mix one lowercase char and two digits -> valid' do
|
134
|
+
# /valid/validSubSpec.json
|
135
|
+
expect(parser.sub_spec).to parse('{$a|$b|$c}', trace: true, reporter: reporter)
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'mix two lowercase chars and one digit -> valid' do
|
139
|
+
# /valid/validSubSpec.json
|
140
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\$}', trace: true, reporter: reporter)
|
141
|
+
end
|
142
|
+
|
143
|
+
it 'one digit two wildcards right -> valid' do
|
144
|
+
# /valid/validSubSpec.json
|
145
|
+
expect(parser.sub_spec).to parse('{$a!=$b}', trace: true, reporter: reporter)
|
146
|
+
end
|
147
|
+
|
148
|
+
it 'one lowercase and two wildcards right -> valid' do
|
149
|
+
# /valid/validSubSpec.json
|
150
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\=}', trace: true, reporter: reporter)
|
151
|
+
end
|
152
|
+
|
153
|
+
it 'one uppercase char two wildcards right -> valid' do
|
154
|
+
# /valid/validSubSpec.json
|
155
|
+
expect(parser.sub_spec).to parse('{$a|$b}{$c|$d}', trace: true, reporter: reporter)
|
156
|
+
end
|
157
|
+
|
158
|
+
it 'one wildcard between uppercase chars -> valid' do
|
159
|
+
# /valid/validSubSpec.json
|
160
|
+
expect(parser.sub_spec).to parse('{$a}{$b|$c}', trace: true, reporter: reporter)
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'one wildcard left and two lowercase chars -> valid' do
|
164
|
+
# /valid/validSubSpec.json
|
165
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\!}', trace: true, reporter: reporter)
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'one wildcard left two uppercase chars -> valid' do
|
169
|
+
# /valid/validSubSpec.json
|
170
|
+
expect(parser.sub_spec).to parse('{$a|$b}{$c}', trace: true, reporter: reporter)
|
171
|
+
end
|
172
|
+
|
173
|
+
it 'one wildcard left with two digits -> valid' do
|
174
|
+
# /valid/validSubSpec.json
|
175
|
+
expect(parser.sub_spec).to parse('{?$a}', trace: true, reporter: reporter)
|
176
|
+
end
|
177
|
+
|
178
|
+
it 'two digits wildcard right -> valid' do
|
179
|
+
# /valid/validSubSpec.json
|
180
|
+
expect(parser.sub_spec).to parse('{$a=$b}', trace: true, reporter: reporter)
|
181
|
+
end
|
182
|
+
|
183
|
+
it 'two wildcards and one lowercase char right -> valid' do
|
184
|
+
# /valid/validSubSpec.json
|
185
|
+
expect(parser.sub_spec).to parse('{$a~\\test\\}}', trace: true, reporter: reporter)
|
186
|
+
end
|
187
|
+
|
188
|
+
it 'two wildcards left one uppercase char -> valid' do
|
189
|
+
# /valid/validSubSpec.json
|
190
|
+
expect(parser.sub_spec).to parse('{/#=\\/}', trace: true, reporter: reporter)
|
191
|
+
end
|
192
|
+
|
193
|
+
it 'two wildcards left with digit -> valid' do
|
194
|
+
# /valid/validSubSpec.json
|
195
|
+
expect(parser.sub_spec).to parse('{$a}', trace: true, reporter: reporter)
|
196
|
+
end
|
197
|
+
|
198
|
+
it 'wildcard between digits -> valid' do
|
199
|
+
# /valid/validSubSpec.json
|
200
|
+
expect(parser.sub_spec).to parse('{!$a}', trace: true, reporter: reporter)
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|