expressir 1.2.3-x64-mingw32 → 1.2.6-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.cross_rubies +0 -6
- data/.github/workflows/rake.yml +223 -31
- data/.gitignore +7 -1
- data/.gitmodules +3 -0
- data/.rubocop.yml +13 -4
- data/README.adoc +8 -0
- data/Rakefile +4 -1
- data/bin/console +0 -1
- data/bin/rspec +3 -3
- data/exe/expressir +4 -2
- data/exe/format +1 -1
- data/exe/format-test +25 -25
- data/exe/generate-parser +16 -13
- data/expressir.gemspec +11 -9
- data/lib/expressir/config.rb +1 -1
- data/lib/expressir/express/2.7/express_parser.so +0 -0
- data/lib/expressir/express/3.0/express_parser.so +0 -0
- data/lib/expressir/express/parser.rb +17 -15
- data/lib/expressir/express/visitor.rb +7 -3
- data/lib/expressir/model.rb +78 -78
- data/lib/expressir/version.rb +1 -1
- data/rakelib/antlr4-native.rake +161 -0
- data/rakelib/cross-ruby.rake +213 -162
- data/spec/acceptance/version_spec.rb +17 -2
- data/spec/expressir/express/cache_spec.rb +23 -5
- data/spec/expressir/express/formatter_spec.rb +54 -8
- data/spec/expressir/express/parser_spec.rb +47 -11
- data/spec/expressir/model/model_element_spec.rb +198 -146
- data/spec/spec_helper.rb +7 -0
- metadata +52 -61
- data/demo.rb +0 -18
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +0 -9589
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +0 -36619
- data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +0 -13294
- data/original/examples/employment/eclipse/.project +0 -17
- data/original/examples/employment/eclipse/Export/Employment.png +0 -0
- data/original/examples/employment/eclipse/Express/employment_schema.exp +0 -33
- data/original/examples/employment/eclipse/Express/employment_schema.xmi +0 -77
- data/original/examples/employment/eclipse/Express/employment_schema.xml +0 -93
- data/original/examples/employment/eclipse/Models/Employment.uml +0 -4
- data/original/examples/employment/eclipse/Models/Employment.umldi +0 -240
- data/original/examples/employment/eclipse/readme.txt +0 -7
- data/original/examples/employment/employment_schema.exp +0 -33
- data/original/examples/employment/employment_schema.rb +0 -232
- data/original/examples/employment/employment_schema.xml +0 -93
- data/original/examples/employment/employment_schema___module.rb +0 -46
- data/original/examples/employment/employment_schema___p28attr.rb +0 -126
- data/original/examples/employment/employment_schema___p28inst.rb +0 -26
- data/original/examples/employment/example_employment_data.xml +0 -1
- data/original/examples/employment/example_employment_data_copy.xml +0 -1
- data/original/examples/employment/example_employment_reader.rb +0 -30
- data/original/examples/employment/example_employment_writer.rb +0 -51
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +0 -3710
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +0 -35880
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +0 -15357
- data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +0 -9468
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +0 -8404
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +0 -43147
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +0 -18341
- data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +0 -11632
- data/original/exp2ruby.rb +0 -525
- data/original/expsm.rb +0 -34
- data/original/mapping_owl.rb +0 -1018
- data/original/mapping_sysml.rb +0 -2281
- data/original/mapping_uml2.rb +0 -599
- data/original/mapping_uml2_eclipse.rb +0 -433
- data/original/reeper.rb +0 -134
- data/spec/expressr_spec.rb +0 -5
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require "yaml"
|
3
2
|
require "spec_helper"
|
4
3
|
require "expressir/express/parser"
|
@@ -6,7 +5,8 @@ require "expressir/express/formatter"
|
|
6
5
|
|
7
6
|
RSpec.describe Expressir::Model::ModelElement do
|
8
7
|
describe ".to_hash" do
|
9
|
-
it "exports an object with a formatter (single.exp)" do
|
8
|
+
it "exports an object with a formatter (single.exp)" do |example|
|
9
|
+
print "\n[#{example.description}] "
|
10
10
|
exp_file = Expressir.root_path.join("spec", "syntax", "single.exp")
|
11
11
|
yaml_file = Expressir.root_path.join("spec", "syntax", "single_formatted.yaml")
|
12
12
|
|
@@ -15,252 +15,304 @@ RSpec.describe Expressir::Model::ModelElement do
|
|
15
15
|
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path, formatter: Expressir::Express::Formatter))
|
16
16
|
# File.write(yaml_file, result)
|
17
17
|
expected_result = File.read(yaml_file)
|
18
|
-
|
18
|
+
|
19
19
|
expect(result).to eq(expected_result)
|
20
|
+
|
21
|
+
# Validate Object Space
|
22
|
+
GC.start
|
23
|
+
GC.verify_compaction_references
|
24
|
+
GC.verify_internal_consistency
|
20
25
|
end
|
21
26
|
end
|
22
27
|
|
23
28
|
describe ".from_hash" do
|
24
|
-
it "parses an object (single.yaml)" do
|
29
|
+
it "parses an object (single.yaml)" do |example|
|
30
|
+
print "\n[#{example.description}] "
|
25
31
|
yaml_file = Expressir.root_path.join("spec", "syntax", "single.yaml")
|
26
32
|
|
27
|
-
input = YAML.
|
33
|
+
input = YAML.safe_load(File.read(yaml_file))
|
28
34
|
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
29
35
|
|
30
36
|
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
|
31
37
|
expected_result = File.read(yaml_file)
|
32
38
|
|
33
39
|
expect(result).to eq(expected_result)
|
40
|
+
|
41
|
+
# Validate Object Space
|
42
|
+
GC.start
|
43
|
+
GC.verify_compaction_references
|
44
|
+
GC.verify_internal_consistency
|
34
45
|
end
|
35
46
|
|
36
|
-
it "parses an object (multiple.yaml)" do
|
47
|
+
it "parses an object (multiple.yaml)" do |example|
|
48
|
+
print "\n[#{example.description}] "
|
37
49
|
yaml_file = Expressir.root_path.join("spec", "syntax", "multiple.yaml")
|
38
50
|
|
39
|
-
input = YAML.
|
51
|
+
input = YAML.safe_load(File.read(yaml_file), permitted_classes: [Symbol]) # For UTF8 symbols
|
40
52
|
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
41
53
|
|
42
54
|
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
|
43
55
|
expected_result = File.read(yaml_file)
|
44
56
|
|
45
57
|
expect(result).to eq(expected_result)
|
58
|
+
|
59
|
+
# Validate Object Space
|
60
|
+
GC.start
|
61
|
+
GC.verify_compaction_references
|
62
|
+
GC.verify_internal_consistency
|
46
63
|
end
|
47
64
|
|
48
|
-
it "parses an object (syntax.yaml)" do
|
65
|
+
it "parses an object (syntax.yaml)" do |example|
|
66
|
+
print "\n[#{example.description}] "
|
49
67
|
yaml_file = Expressir.root_path.join("spec", "syntax", "syntax.yaml")
|
50
68
|
|
51
|
-
input = YAML.
|
69
|
+
input = YAML.safe_load(File.read(yaml_file), permitted_classes: [Symbol]) # For UTF8 symbols
|
52
70
|
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
53
71
|
|
54
72
|
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
|
55
73
|
expected_result = File.read(yaml_file)
|
56
74
|
|
57
75
|
expect(result).to eq(expected_result)
|
76
|
+
|
77
|
+
GC.start
|
78
|
+
GC.verify_compaction_references
|
79
|
+
GC.verify_internal_consistency
|
58
80
|
end
|
59
81
|
|
60
|
-
it "parses an object (remark.yaml)" do
|
82
|
+
it "parses an object (remark.yaml)" do |example|
|
83
|
+
print "\n[#{example.description}] "
|
61
84
|
yaml_file = Expressir.root_path.join("spec", "syntax", "remark.yaml")
|
62
85
|
|
63
|
-
input = YAML.
|
86
|
+
input = YAML.safe_load(File.read(yaml_file), permitted_classes: [Symbol]) # For UTF8 symbols
|
64
87
|
repo = Expressir::Model::ModelElement.from_hash(input, root_path: Expressir.root_path)
|
65
88
|
|
66
89
|
result = YAML.dump(repo.to_hash(root_path: Expressir.root_path))
|
67
90
|
expected_result = File.read(yaml_file)
|
68
91
|
|
69
92
|
expect(result).to eq(expected_result)
|
93
|
+
|
94
|
+
# Validate Object Space
|
95
|
+
GC.start
|
96
|
+
GC.verify_compaction_references
|
97
|
+
GC.verify_internal_consistency
|
70
98
|
end
|
71
99
|
end
|
72
100
|
|
73
101
|
describe ".find" do
|
74
|
-
it "finds an object (single.exp)" do
|
102
|
+
it "finds an object (single.exp)" do |example|
|
103
|
+
print "\n[#{example.description}] "
|
75
104
|
exp_file = Expressir.root_path.join("spec", "syntax", "single.exp")
|
76
105
|
|
77
106
|
repo = Expressir::Express::Parser.from_file(exp_file)
|
78
107
|
|
79
108
|
# universal scope
|
80
|
-
expect(repo.find(
|
81
|
-
expect(repo.find(
|
109
|
+
expect(repo.find("single_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
|
110
|
+
expect(repo.find("single_schema.empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
82
111
|
|
83
112
|
# schema scope
|
84
113
|
schema = repo.schemas.first
|
85
|
-
expect(schema.find(
|
114
|
+
expect(schema.find("empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
115
|
+
|
116
|
+
# Validate Object Space
|
117
|
+
GC.start
|
118
|
+
GC.verify_compaction_references
|
119
|
+
GC.verify_internal_consistency
|
86
120
|
end
|
87
121
|
|
88
|
-
it "finds an object (multiple.exp)" do
|
122
|
+
it "finds an object (multiple.exp)" do |example|
|
123
|
+
print "\n[#{example.description}] "
|
89
124
|
exp_file = Expressir.root_path.join("spec", "syntax", "multiple.exp")
|
90
125
|
|
91
126
|
repo = Expressir::Express::Parser.from_file(exp_file)
|
92
127
|
|
93
128
|
# universal scope
|
94
|
-
expect(repo.find(
|
95
|
-
expect(repo.find(
|
96
|
-
expect(repo.find(
|
97
|
-
expect(repo.find(
|
98
|
-
expect(repo.find(
|
99
|
-
expect(repo.find(
|
129
|
+
expect(repo.find("multiple_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
|
130
|
+
expect(repo.find("multiple_schema.empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
131
|
+
expect(repo.find("multiple_schema.attribute_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
132
|
+
expect(repo.find("multiple_schema.attribute_entity2")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
133
|
+
expect(repo.find("multiple_schema.attribute_entity3")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
134
|
+
expect(repo.find("multiple_schema.attribute_entity4")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
100
135
|
|
101
136
|
# schema scope
|
102
137
|
schema = repo.schemas.first
|
103
|
-
expect(schema.find(
|
104
|
-
expect(schema.find(
|
105
|
-
expect(schema.find(
|
106
|
-
expect(schema.find(
|
107
|
-
expect(schema.find(
|
138
|
+
expect(schema.find("empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
139
|
+
expect(schema.find("attribute_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
140
|
+
expect(schema.find("attribute_entity2")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
141
|
+
expect(schema.find("attribute_entity3")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
142
|
+
expect(schema.find("attribute_entity4")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
143
|
+
|
144
|
+
# Validate Object Space
|
145
|
+
GC.start
|
146
|
+
GC.verify_compaction_references
|
147
|
+
GC.verify_internal_consistency
|
108
148
|
end
|
109
149
|
|
110
|
-
it "finds an object (syntax.exp)" do
|
150
|
+
it "finds an object (syntax.exp)" do |example|
|
151
|
+
print "\n[#{example.description}] "
|
111
152
|
exp_file = Expressir.root_path.join("spec", "syntax", "syntax.exp")
|
112
153
|
|
113
154
|
repo = Expressir::Express::Parser.from_file(exp_file)
|
114
155
|
|
115
156
|
# universal scope
|
116
|
-
expect(repo.find(
|
117
|
-
expect(repo.find(
|
157
|
+
expect(repo.find("syntax_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
|
158
|
+
expect(repo.find("syntax_schema.empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
118
159
|
|
119
160
|
# schema scope
|
120
161
|
schema = repo.schemas.first
|
121
|
-
expect(schema.find(
|
162
|
+
expect(schema.find("empty_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
163
|
+
|
164
|
+
# Validate Object Space
|
165
|
+
GC.start
|
166
|
+
GC.verify_compaction_references
|
167
|
+
GC.verify_internal_consistency
|
122
168
|
end
|
123
169
|
|
124
|
-
it "finds an object (remark.exp)" do
|
170
|
+
it "finds an object (remark.exp)" do |example|
|
171
|
+
print "\n[#{example.description}] "
|
125
172
|
exp_file = Expressir.root_path.join("spec", "syntax", "remark.exp")
|
126
173
|
|
127
174
|
repo = Expressir::Express::Parser.from_file(exp_file)
|
128
175
|
|
129
176
|
# universal scope
|
130
|
-
expect(repo.find(
|
131
|
-
expect(repo.find(
|
132
|
-
expect(repo.find(
|
133
|
-
expect(repo.find(
|
134
|
-
expect(repo.find(
|
135
|
-
expect(repo.find(
|
136
|
-
expect(repo.find(
|
137
|
-
expect(repo.find(
|
138
|
-
expect(repo.find(
|
139
|
-
expect(repo.find(
|
140
|
-
expect(repo.find(
|
141
|
-
expect(repo.find(
|
142
|
-
expect(repo.find(
|
143
|
-
expect(repo.find(
|
144
|
-
expect(repo.find(
|
145
|
-
expect(repo.find(
|
146
|
-
expect(repo.find(
|
147
|
-
expect(repo.find(
|
148
|
-
expect(repo.find(
|
149
|
-
expect(repo.find(
|
150
|
-
expect(repo.find(
|
151
|
-
expect(repo.find(
|
152
|
-
expect(repo.find(
|
153
|
-
expect(repo.find(
|
154
|
-
expect(repo.find(
|
155
|
-
expect(repo.find(
|
156
|
-
expect(repo.find(
|
157
|
-
expect(repo.find(
|
158
|
-
expect(repo.find(
|
159
|
-
expect(repo.find(
|
160
|
-
expect(repo.find(
|
161
|
-
expect(repo.find(
|
162
|
-
expect(repo.find(
|
163
|
-
expect(repo.find(
|
164
|
-
expect(repo.find(
|
165
|
-
expect(repo.find(
|
166
|
-
expect(repo.find(
|
167
|
-
expect(repo.find(
|
168
|
-
expect(repo.find(
|
169
|
-
expect(repo.find(
|
177
|
+
expect(repo.find("remark_schema")).to be_instance_of(Expressir::Model::Declarations::Schema)
|
178
|
+
expect(repo.find("remark_schema.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
179
|
+
expect(repo.find("remark_schema.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
180
|
+
expect(repo.find("remark_schema.remark_type.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
181
|
+
expect(repo.find("remark_schema.remark_type.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
182
|
+
expect(repo.find("remark_schema.remark_type.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
183
|
+
expect(repo.find("remark_schema.remark_type.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
184
|
+
expect(repo.find("remark_schema.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
185
|
+
expect(repo.find("remark_schema.remark_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
186
|
+
expect(repo.find("remark_schema.remark_entity.remark_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
187
|
+
expect(repo.find("remark_schema.remark_entity.remark_derived_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
188
|
+
expect(repo.find("remark_schema.remark_entity.remark_inverse_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
189
|
+
expect(repo.find("remark_schema.remark_entity.UR1")).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
|
190
|
+
expect(repo.find("remark_schema.remark_entity.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
191
|
+
expect(repo.find("remark_schema.remark_entity.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
192
|
+
expect(repo.find("remark_schema.remark_entity.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
193
|
+
expect(repo.find("remark_schema.remark_entity.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
194
|
+
expect(repo.find("remark_schema.remark_subtype_constraint")).to be_instance_of(Expressir::Model::Declarations::SubtypeConstraint)
|
195
|
+
expect(repo.find("remark_schema.remark_function")).to be_instance_of(Expressir::Model::Declarations::Function)
|
196
|
+
expect(repo.find("remark_schema.remark_function.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
|
197
|
+
expect(repo.find("remark_schema.remark_function.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
198
|
+
expect(repo.find("remark_schema.remark_function.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
199
|
+
expect(repo.find("remark_schema.remark_function.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
200
|
+
expect(repo.find("remark_schema.remark_function.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
201
|
+
expect(repo.find("remark_schema.remark_procedure")).to be_instance_of(Expressir::Model::Declarations::Procedure)
|
202
|
+
expect(repo.find("remark_schema.remark_procedure.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
|
203
|
+
expect(repo.find("remark_schema.remark_procedure.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
204
|
+
expect(repo.find("remark_schema.remark_procedure.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
205
|
+
expect(repo.find("remark_schema.remark_procedure.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
206
|
+
expect(repo.find("remark_schema.remark_procedure.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
207
|
+
expect(repo.find("remark_schema.remark_rule")).to be_instance_of(Expressir::Model::Declarations::Rule)
|
208
|
+
expect(repo.find("remark_schema.remark_rule.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
209
|
+
expect(repo.find("remark_schema.remark_rule.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
210
|
+
expect(repo.find("remark_schema.remark_rule.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
211
|
+
expect(repo.find("remark_schema.remark_rule.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
212
|
+
expect(repo.find("remark_schema.remark_rule.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
213
|
+
expect(repo.find("remark_schema.remark_rule.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
214
|
+
expect(repo.find("remark_schema.remark_rule.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
215
|
+
expect(repo.find("remark_schema.remark_rule.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
216
|
+
expect(repo.find("remark_schema.remark_item")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
170
217
|
|
171
218
|
# schema scope
|
172
219
|
schema = repo.schemas.first
|
173
|
-
expect(schema.find(
|
174
|
-
expect(schema.find(
|
175
|
-
expect(schema.find(
|
176
|
-
expect(schema.find(
|
177
|
-
expect(schema.find(
|
178
|
-
expect(schema.find(
|
179
|
-
expect(schema.find(
|
180
|
-
expect(schema.find(
|
181
|
-
expect(schema.find(
|
182
|
-
expect(schema.find(
|
183
|
-
expect(schema.find(
|
184
|
-
expect(schema.find(
|
185
|
-
expect(schema.find(
|
186
|
-
expect(schema.find(
|
187
|
-
expect(schema.find(
|
188
|
-
expect(schema.find(
|
189
|
-
expect(schema.find(
|
190
|
-
expect(schema.find(
|
191
|
-
expect(schema.find(
|
192
|
-
expect(schema.find(
|
193
|
-
expect(schema.find(
|
194
|
-
expect(schema.find(
|
195
|
-
expect(schema.find(
|
196
|
-
expect(schema.find(
|
197
|
-
expect(schema.find(
|
198
|
-
expect(schema.find(
|
199
|
-
expect(schema.find(
|
200
|
-
expect(schema.find(
|
201
|
-
expect(schema.find(
|
202
|
-
expect(schema.find(
|
203
|
-
expect(schema.find(
|
204
|
-
expect(schema.find(
|
205
|
-
expect(schema.find(
|
206
|
-
expect(schema.find(
|
207
|
-
expect(schema.find(
|
208
|
-
expect(schema.find(
|
209
|
-
expect(schema.find(
|
210
|
-
expect(schema.find(
|
211
|
-
expect(schema.find(
|
220
|
+
expect(schema.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
221
|
+
expect(schema.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
222
|
+
expect(schema.find("remark_type.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
223
|
+
expect(schema.find("remark_type.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
224
|
+
expect(schema.find("remark_type.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
225
|
+
expect(schema.find("remark_type.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
226
|
+
expect(schema.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
227
|
+
expect(schema.find("remark_entity")).to be_instance_of(Expressir::Model::Declarations::Entity)
|
228
|
+
expect(schema.find("remark_entity.remark_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
229
|
+
expect(schema.find("remark_entity.remark_derived_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
230
|
+
expect(schema.find("remark_entity.remark_inverse_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
231
|
+
expect(schema.find("remark_entity.UR1")).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
|
232
|
+
expect(schema.find("remark_entity.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
233
|
+
expect(schema.find("remark_entity.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
234
|
+
expect(schema.find("remark_entity.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
235
|
+
expect(schema.find("remark_entity.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
236
|
+
expect(schema.find("remark_subtype_constraint")).to be_instance_of(Expressir::Model::Declarations::SubtypeConstraint)
|
237
|
+
expect(schema.find("remark_function")).to be_instance_of(Expressir::Model::Declarations::Function)
|
238
|
+
expect(schema.find("remark_function.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
|
239
|
+
expect(schema.find("remark_function.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
240
|
+
expect(schema.find("remark_function.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
241
|
+
expect(schema.find("remark_function.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
242
|
+
expect(schema.find("remark_function.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
243
|
+
expect(schema.find("remark_procedure")).to be_instance_of(Expressir::Model::Declarations::Procedure)
|
244
|
+
expect(schema.find("remark_procedure.remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
|
245
|
+
expect(schema.find("remark_procedure.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
246
|
+
expect(schema.find("remark_procedure.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
247
|
+
expect(schema.find("remark_procedure.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
248
|
+
expect(schema.find("remark_procedure.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
249
|
+
expect(schema.find("remark_rule")).to be_instance_of(Expressir::Model::Declarations::Rule)
|
250
|
+
expect(schema.find("remark_rule.remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
251
|
+
expect(schema.find("remark_rule.remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
252
|
+
expect(schema.find("remark_rule.remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
253
|
+
expect(schema.find("remark_rule.remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
254
|
+
expect(schema.find("remark_rule.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
255
|
+
expect(schema.find("remark_rule.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
256
|
+
expect(schema.find("remark_rule.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
257
|
+
expect(schema.find("remark_rule.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
258
|
+
expect(schema.find("remark_item")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
212
259
|
|
213
260
|
# type scope
|
214
261
|
type = schema.types.first
|
215
|
-
expect(type.find(
|
216
|
-
expect(type.find(
|
217
|
-
expect(type.find(
|
218
|
-
expect(type.find(
|
262
|
+
expect(type.find("WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
263
|
+
expect(type.find("wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
264
|
+
expect(type.find("IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
265
|
+
expect(type.find("ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
219
266
|
|
220
267
|
# entity scope
|
221
268
|
entity = schema.entities.first
|
222
|
-
expect(entity.find(
|
223
|
-
expect(entity.find(
|
224
|
-
expect(entity.find(
|
225
|
-
expect(entity.find(
|
226
|
-
expect(entity.find(
|
227
|
-
expect(entity.find(
|
228
|
-
expect(entity.find(
|
229
|
-
expect(entity.find(
|
269
|
+
expect(entity.find("remark_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
270
|
+
expect(entity.find("remark_derived_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
271
|
+
expect(entity.find("remark_inverse_attribute")).to be_instance_of(Expressir::Model::Declarations::Attribute)
|
272
|
+
expect(entity.find("UR1")).to be_instance_of(Expressir::Model::Declarations::UniqueRule)
|
273
|
+
expect(entity.find("WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
274
|
+
expect(entity.find("wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
275
|
+
expect(entity.find("IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
276
|
+
expect(entity.find("ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
230
277
|
|
231
278
|
# function scope
|
232
279
|
function = schema.functions.first
|
233
|
-
expect(function.find(
|
234
|
-
expect(function.find(
|
235
|
-
expect(function.find(
|
236
|
-
expect(function.find(
|
237
|
-
expect(function.find(
|
280
|
+
expect(function.find("remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
|
281
|
+
expect(function.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
282
|
+
expect(function.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
283
|
+
expect(function.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
284
|
+
expect(function.find("remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
238
285
|
|
239
286
|
# procedure scope
|
240
287
|
procedure = schema.procedures.first
|
241
|
-
expect(procedure.find(
|
242
|
-
expect(procedure.find(
|
243
|
-
expect(procedure.find(
|
244
|
-
expect(procedure.find(
|
245
|
-
expect(procedure.find(
|
288
|
+
expect(procedure.find("remark_parameter")).to be_instance_of(Expressir::Model::Declarations::Parameter)
|
289
|
+
expect(procedure.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
290
|
+
expect(procedure.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
291
|
+
expect(procedure.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
292
|
+
expect(procedure.find("remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
246
293
|
|
247
294
|
# rule scope
|
248
295
|
rule = schema.rules.first
|
249
|
-
expect(rule.find(
|
250
|
-
expect(rule.find(
|
251
|
-
expect(rule.find(
|
252
|
-
expect(rule.find(
|
253
|
-
expect(rule.find(
|
254
|
-
expect(rule.find(
|
255
|
-
expect(rule.find(
|
256
|
-
expect(rule.find(
|
296
|
+
expect(rule.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
297
|
+
expect(rule.find("remark_enumeration_item")).to be_instance_of(Expressir::Model::DataTypes::EnumerationItem)
|
298
|
+
expect(rule.find("remark_constant")).to be_instance_of(Expressir::Model::Declarations::Constant)
|
299
|
+
expect(rule.find("remark_variable")).to be_instance_of(Expressir::Model::Declarations::Variable)
|
300
|
+
expect(rule.find("WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
301
|
+
expect(rule.find("wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
302
|
+
expect(rule.find("IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
303
|
+
expect(rule.find("ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
257
304
|
|
258
305
|
# retry search in parent scope
|
259
|
-
expect(entity.find(
|
260
|
-
expect(entity.find(
|
261
|
-
expect(entity.find(
|
262
|
-
expect(entity.find(
|
263
|
-
expect(entity.find(
|
306
|
+
expect(entity.find("remark_type")).to be_instance_of(Expressir::Model::Declarations::Type)
|
307
|
+
expect(entity.find("remark_type.WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
308
|
+
expect(entity.find("remark_type.wr:WR1")).to be_instance_of(Expressir::Model::Declarations::WhereRule)
|
309
|
+
expect(entity.find("remark_type.IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
310
|
+
expect(entity.find("remark_type.ip:IP1")).to be_instance_of(Expressir::Model::Declarations::RemarkItem)
|
311
|
+
|
312
|
+
# Validate Object Space
|
313
|
+
GC.start
|
314
|
+
GC.verify_compaction_references
|
315
|
+
GC.verify_internal_consistency
|
264
316
|
end
|
265
317
|
end
|
266
318
|
end
|
data/spec/spec_helper.rb
CHANGED