expressir 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/lib/expressir/express_exp/formatter.rb +1444 -0
  4. data/lib/expressir/express_exp/visitor.rb +288 -280
  5. data/lib/expressir/model.rb +13 -42
  6. data/lib/expressir/model/{derived.rb → attribute.rb} +13 -4
  7. data/lib/expressir/model/constant.rb +2 -1
  8. data/lib/expressir/model/entity.rb +22 -17
  9. data/lib/expressir/model/enumeration_item.rb +2 -1
  10. data/lib/expressir/model/expressions/aggregate_initializer.rb +9 -9
  11. data/lib/expressir/model/expressions/aggregate_item.rb +15 -0
  12. data/lib/expressir/model/expressions/{attribute_qualifier.rb → attribute_reference.rb} +3 -1
  13. data/lib/expressir/model/expressions/binary_expression.rb +40 -0
  14. data/lib/expressir/model/expressions/{function_call.rb → call.rb} +3 -3
  15. data/lib/expressir/model/expressions/entity_constructor.rb +11 -11
  16. data/lib/expressir/model/expressions/{group_qualifier.rb → group_reference.rb} +3 -1
  17. data/lib/expressir/model/expressions/{index_qualifier.rb → index_reference.rb} +3 -1
  18. data/lib/expressir/model/expressions/interval.rb +17 -17
  19. data/lib/expressir/model/expressions/query_expression.rb +26 -0
  20. data/lib/expressir/model/expressions/simple_reference.rb +13 -0
  21. data/lib/expressir/model/expressions/{expression.rb → unary_expression.rb} +7 -3
  22. data/lib/expressir/model/function.rb +14 -6
  23. data/lib/expressir/model/{reference.rb → interface.rb} +6 -1
  24. data/lib/expressir/model/literals/logical.rb +4 -0
  25. data/lib/expressir/model/parameter.rb +4 -3
  26. data/lib/expressir/model/procedure.rb +14 -6
  27. data/lib/expressir/model/repository.rb +1 -1
  28. data/lib/expressir/model/rule.rb +16 -8
  29. data/lib/expressir/model/schema.rb +22 -6
  30. data/lib/expressir/model/statements/alias.rb +3 -2
  31. data/lib/expressir/model/statements/{procedure_call.rb → call.rb} +3 -3
  32. data/lib/expressir/model/statements/case.rb +2 -2
  33. data/lib/expressir/model/statements/case_action.rb +2 -2
  34. data/lib/expressir/model/statements/repeat.rb +3 -2
  35. data/lib/expressir/model/subtype_constraint.rb +6 -5
  36. data/lib/expressir/model/type.rb +3 -2
  37. data/lib/expressir/model/types/aggregate.rb +2 -1
  38. data/lib/expressir/model/types/generic.rb +2 -1
  39. data/lib/expressir/model/types/generic_entity.rb +2 -1
  40. data/lib/expressir/model/unique.rb +2 -1
  41. data/lib/expressir/model/{local.rb → variable.rb} +3 -2
  42. data/lib/expressir/model/where.rb +2 -1
  43. data/lib/expressir/version.rb +1 -1
  44. data/original/examples/syntax/remark.exp +126 -108
  45. data/original/examples/syntax/remark_formatted.exp +172 -0
  46. data/original/examples/syntax/syntax.exp +287 -277
  47. data/original/examples/syntax/syntax_formatted.exp +1176 -0
  48. data/spec/expressir/express_exp/format_remark_spec.rb +28 -0
  49. data/spec/expressir/express_exp/format_syntax_spec.rb +28 -0
  50. data/spec/expressir/express_exp/{remark_spec.rb → parse_remark_spec.rb} +80 -36
  51. data/spec/expressir/express_exp/parse_syntax_spec.rb +2998 -0
  52. metadata +22 -46
  53. data/lib/expressir/model/explicit.rb +0 -19
  54. data/lib/expressir/model/expressions/aggregate_element.rb +0 -15
  55. data/lib/expressir/model/expressions/qualified_ref.rb +0 -15
  56. data/lib/expressir/model/expressions/query.rb +0 -25
  57. data/lib/expressir/model/inverse.rb +0 -19
  58. data/lib/expressir/model/operators/addition.rb +0 -8
  59. data/lib/expressir/model/operators/and.rb +0 -8
  60. data/lib/expressir/model/operators/andor.rb +0 -8
  61. data/lib/expressir/model/operators/combine.rb +0 -8
  62. data/lib/expressir/model/operators/equal.rb +0 -8
  63. data/lib/expressir/model/operators/exponentiation.rb +0 -8
  64. data/lib/expressir/model/operators/greater_than.rb +0 -8
  65. data/lib/expressir/model/operators/greater_than_or_equal.rb +0 -8
  66. data/lib/expressir/model/operators/in.rb +0 -8
  67. data/lib/expressir/model/operators/instance_equal.rb +0 -8
  68. data/lib/expressir/model/operators/instance_not_equal.rb +0 -8
  69. data/lib/expressir/model/operators/integer_division.rb +0 -8
  70. data/lib/expressir/model/operators/less_than.rb +0 -8
  71. data/lib/expressir/model/operators/less_than_or_equal.rb +0 -8
  72. data/lib/expressir/model/operators/like.rb +0 -8
  73. data/lib/expressir/model/operators/modulo.rb +0 -8
  74. data/lib/expressir/model/operators/multiplication.rb +0 -8
  75. data/lib/expressir/model/operators/not.rb +0 -8
  76. data/lib/expressir/model/operators/not_equal.rb +0 -8
  77. data/lib/expressir/model/operators/oneof.rb +0 -8
  78. data/lib/expressir/model/operators/or.rb +0 -8
  79. data/lib/expressir/model/operators/real_division.rb +0 -8
  80. data/lib/expressir/model/operators/subtraction.rb +0 -8
  81. data/lib/expressir/model/operators/unary_minus.rb +0 -8
  82. data/lib/expressir/model/operators/unary_plus.rb +0 -8
  83. data/lib/expressir/model/operators/xor.rb +0 -8
  84. data/lib/expressir/model/ref.rb +0 -11
  85. data/lib/expressir/model/use.rb +0 -13
  86. data/spec/expressir/express_exp/syntax_spec.rb +0 -2992
@@ -1,8 +0,0 @@
1
- module Expressir
2
- module Model
3
- module Operators
4
- class RealDivision
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Expressir
2
- module Model
3
- module Operators
4
- class Subtraction
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Expressir
2
- module Model
3
- module Operators
4
- class UnaryMinus
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Expressir
2
- module Model
3
- module Operators
4
- class UnaryPlus
5
- end
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Expressir
2
- module Model
3
- module Operators
4
- class Xor
5
- end
6
- end
7
- end
8
- end
@@ -1,11 +0,0 @@
1
- module Expressir
2
- module Model
3
- class Ref
4
- attr_accessor :id
5
-
6
- def initialize(options = {})
7
- @id = options[:id]
8
- end
9
- end
10
- end
11
- end
@@ -1,13 +0,0 @@
1
- module Expressir
2
- module Model
3
- class Use
4
- attr_accessor :schema
5
- attr_accessor :items
6
-
7
- def initialize(options = {})
8
- @schema = options[:schema]
9
- @items = options[:items]
10
- end
11
- end
12
- end
13
- end
@@ -1,2992 +0,0 @@
1
- require "spec_helper"
2
- require "expressir/express_exp/parser"
3
-
4
- RSpec.describe Expressir::ExpressExp::Parser do
5
- describe ".from_file" do
6
- it "build an instance from a file" do
7
- repo = Expressir::ExpressExp::Parser.from_exp(sample_file)
8
-
9
- schemas = repo.schemas
10
-
11
- schema = schemas.find{|x| x.id == "syntaxSchema"}
12
- expect(schema.version).to be_instance_of(Expressir::Model::Literals::String)
13
- expect(schema.version.value).to eq("version")
14
-
15
- interfaces = schema.interfaces
16
- constants = schema.constants
17
- types = schema.types
18
- entities = schema.entities
19
- subtype_constraints = schema.subtype_constraints
20
- functions = schema.functions
21
- procedures = schema.procedures
22
- rules = schema.rules
23
-
24
- # intefaces
25
- interfaces.find{|x| x.schema.id == "useInterface"}.tap do |x|
26
- expect(x).to be_instance_of(Expressir::Model::Use)
27
- end
28
-
29
- interfaces.find{|x| x.schema.id == "useItemInterface"}.tap do |x|
30
- expect(x).to be_instance_of(Expressir::Model::Use)
31
- expect(x.items).to be_instance_of(Array)
32
- expect(x.items.count).to eq(1)
33
- expect(x.items[0]).to be_instance_of(Expressir::Model::Ref)
34
- expect(x.items[0].id).to eq("test")
35
- end
36
-
37
- interfaces.find{|x| x.schema.id == "useItemRenameInterface"}.tap do |x|
38
- expect(x).to be_instance_of(Expressir::Model::Use)
39
- expect(x.items).to be_instance_of(Array)
40
- expect(x.items.count).to eq(1)
41
- expect(x.items[0]).to be_instance_of(Expressir::Model::RenamedRef)
42
- expect(x.items[0].ref).to be_instance_of(Expressir::Model::Ref)
43
- expect(x.items[0].ref.id).to eq("test")
44
- expect(x.items[0].id).to eq("test2")
45
- end
46
-
47
- interfaces.find{|x| x.schema.id == "referenceInterface"}.tap do |x|
48
- expect(x).to be_instance_of(Expressir::Model::Reference)
49
- end
50
-
51
- interfaces.find{|x| x.schema.id == "referenceItemInterface"}.tap do |x|
52
- expect(x).to be_instance_of(Expressir::Model::Reference)
53
- expect(x.items).to be_instance_of(Array)
54
- expect(x.items.count).to eq(1)
55
- expect(x.items[0]).to be_instance_of(Expressir::Model::Ref)
56
- expect(x.items[0].id).to eq("test")
57
- end
58
-
59
- interfaces.find{|x| x.schema.id == "referenceItemRenameInterface"}.tap do |x|
60
- expect(x).to be_instance_of(Expressir::Model::Reference)
61
- expect(x.items).to be_instance_of(Array)
62
- expect(x.items.count).to eq(1)
63
- expect(x.items[0]).to be_instance_of(Expressir::Model::RenamedRef)
64
- expect(x.items[0].ref).to be_instance_of(Expressir::Model::Ref)
65
- expect(x.items[0].ref.id).to eq("test")
66
- expect(x.items[0].id).to eq("test2")
67
- end
68
-
69
- # literals
70
- constants.find{|x| x.id == "binaryExpression"}.expression.tap do |x|
71
- expect(x).to be_instance_of(Expressir::Model::Literals::Binary)
72
- expect(x.value).to eq("011110000111100001111000")
73
- end
74
-
75
- constants.find{|x| x.id == "integerExpression"}.expression.tap do |x|
76
- expect(x).to be_instance_of(Expressir::Model::Literals::Integer)
77
- expect(x.value).to eq("999")
78
- end
79
-
80
- constants.find{|x| x.id == "trueLogicalExpression"}.expression.tap do |x|
81
- expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
82
- expect(x.value).to eq(true)
83
- end
84
-
85
- constants.find{|x| x.id == "falseLogicalExpression"}.expression.tap do |x|
86
- expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
87
- expect(x.value).to eq(false)
88
- end
89
-
90
- constants.find{|x| x.id == "unknownLogicalExpression"}.expression.tap do |x|
91
- expect(x).to be_instance_of(Expressir::Model::Literals::Logical)
92
- expect(x.value).to eq(nil)
93
- end
94
-
95
- constants.find{|x| x.id == "realExpression"}.expression.tap do |x|
96
- expect(x).to be_instance_of(Expressir::Model::Literals::Real)
97
- expect(x.value).to eq("999.999")
98
- end
99
-
100
- constants.find{|x| x.id == "simpleStringExpression"}.expression.tap do |x|
101
- expect(x).to be_instance_of(Expressir::Model::Literals::String)
102
- expect(x.value).to eq("xxx")
103
- end
104
-
105
- constants.find{|x| x.id == "encodedStringExpression"}.expression.tap do |x|
106
- expect(x).to be_instance_of(Expressir::Model::Literals::String)
107
- expect(x.value).to eq("000000780000007800000078")
108
- expect(x.encoded).to eq(true)
109
- end
110
-
111
- # constants
112
- constants.find{|x| x.id == "constEExpression"}.expression.tap do |x|
113
- expect(x).to be_instance_of(Expressir::Model::Ref)
114
- expect(x.id).to eq("CONST_E")
115
- end
116
-
117
- constants.find{|x| x.id == "indeterminateExpression"}.expression.tap do |x|
118
- expect(x).to be_instance_of(Expressir::Model::Ref)
119
- expect(x.id).to eq("?")
120
- end
121
-
122
- constants.find{|x| x.id == "piExpression"}.expression.tap do |x|
123
- expect(x).to be_instance_of(Expressir::Model::Ref)
124
- expect(x.id).to eq("PI")
125
- end
126
-
127
- constants.find{|x| x.id == "selfExpression"}.expression.tap do |x|
128
- expect(x).to be_instance_of(Expressir::Model::Ref)
129
- expect(x.id).to eq("SELF")
130
- end
131
-
132
- # functions
133
- constants.find{|x| x.id == "absExpression"}.expression.tap do |x|
134
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
135
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
136
- expect(x.function.id).to eq("ABS")
137
- expect(x.parameters).to be_instance_of(Array)
138
- expect(x.parameters.count).to eq(1)
139
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
140
- expect(x.parameters[0].value).to eq(true)
141
- end
142
-
143
- constants.find{|x| x.id == "acosExpression"}.expression.tap do |x|
144
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
145
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
146
- expect(x.function.id).to eq("ACOS")
147
- expect(x.parameters).to be_instance_of(Array)
148
- expect(x.parameters.count).to eq(1)
149
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
150
- expect(x.parameters[0].value).to eq(true)
151
- end
152
-
153
- constants.find{|x| x.id == "asinExpression"}.expression.tap do |x|
154
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
155
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
156
- expect(x.function.id).to eq("ASIN")
157
- expect(x.parameters).to be_instance_of(Array)
158
- expect(x.parameters.count).to eq(1)
159
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
160
- expect(x.parameters[0].value).to eq(true)
161
- end
162
-
163
- constants.find{|x| x.id == "atanExpression"}.expression.tap do |x|
164
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
165
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
166
- expect(x.function.id).to eq("ATAN")
167
- expect(x.parameters).to be_instance_of(Array)
168
- expect(x.parameters.count).to eq(1)
169
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
170
- expect(x.parameters[0].value).to eq(true)
171
- end
172
-
173
- constants.find{|x| x.id == "blengthExpression"}.expression.tap do |x|
174
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
175
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
176
- expect(x.function.id).to eq("BLENGTH")
177
- expect(x.parameters).to be_instance_of(Array)
178
- expect(x.parameters.count).to eq(1)
179
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
180
- expect(x.parameters[0].value).to eq(true)
181
- end
182
-
183
- constants.find{|x| x.id == "cosExpression"}.expression.tap do |x|
184
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
185
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
186
- expect(x.function.id).to eq("COS")
187
- expect(x.parameters).to be_instance_of(Array)
188
- expect(x.parameters.count).to eq(1)
189
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
190
- expect(x.parameters[0].value).to eq(true)
191
- end
192
-
193
- constants.find{|x| x.id == "existsExpression"}.expression.tap do |x|
194
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
195
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
196
- expect(x.function.id).to eq("EXISTS")
197
- expect(x.parameters).to be_instance_of(Array)
198
- expect(x.parameters.count).to eq(1)
199
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
200
- expect(x.parameters[0].value).to eq(true)
201
- end
202
-
203
- constants.find{|x| x.id == "expExpression"}.expression.tap do |x|
204
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
205
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
206
- expect(x.function.id).to eq("EXP")
207
- expect(x.parameters).to be_instance_of(Array)
208
- expect(x.parameters.count).to eq(1)
209
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
210
- expect(x.parameters[0].value).to eq(true)
211
- end
212
-
213
- constants.find{|x| x.id == "formatExpression"}.expression.tap do |x|
214
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
215
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
216
- expect(x.function.id).to eq("FORMAT")
217
- expect(x.parameters).to be_instance_of(Array)
218
- expect(x.parameters.count).to eq(1)
219
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
220
- expect(x.parameters[0].value).to eq(true)
221
- end
222
-
223
- constants.find{|x| x.id == "hiboundExpression"}.expression.tap do |x|
224
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
225
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
226
- expect(x.function.id).to eq("HIBOUND")
227
- expect(x.parameters).to be_instance_of(Array)
228
- expect(x.parameters.count).to eq(1)
229
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
230
- expect(x.parameters[0].value).to eq(true)
231
- end
232
-
233
- constants.find{|x| x.id == "hiindexExpression"}.expression.tap do |x|
234
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
235
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
236
- expect(x.function.id).to eq("HIINDEX")
237
- expect(x.parameters).to be_instance_of(Array)
238
- expect(x.parameters.count).to eq(1)
239
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
240
- expect(x.parameters[0].value).to eq(true)
241
- end
242
-
243
- constants.find{|x| x.id == "lengthExpression"}.expression.tap do |x|
244
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
245
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
246
- expect(x.function.id).to eq("LENGTH")
247
- expect(x.parameters).to be_instance_of(Array)
248
- expect(x.parameters.count).to eq(1)
249
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
250
- expect(x.parameters[0].value).to eq(true)
251
- end
252
-
253
- constants.find{|x| x.id == "loboundExpression"}.expression.tap do |x|
254
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
255
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
256
- expect(x.function.id).to eq("LOBOUND")
257
- expect(x.parameters).to be_instance_of(Array)
258
- expect(x.parameters.count).to eq(1)
259
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
260
- expect(x.parameters[0].value).to eq(true)
261
- end
262
-
263
- constants.find{|x| x.id == "loindexExpression"}.expression.tap do |x|
264
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
265
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
266
- expect(x.function.id).to eq("LOINDEX")
267
- expect(x.parameters).to be_instance_of(Array)
268
- expect(x.parameters.count).to eq(1)
269
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
270
- expect(x.parameters[0].value).to eq(true)
271
- end
272
-
273
- constants.find{|x| x.id == "logExpression"}.expression.tap do |x|
274
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
275
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
276
- expect(x.function.id).to eq("LOG")
277
- expect(x.parameters).to be_instance_of(Array)
278
- expect(x.parameters.count).to eq(1)
279
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
280
- expect(x.parameters[0].value).to eq(true)
281
- end
282
-
283
- constants.find{|x| x.id == "log2Expression"}.expression.tap do |x|
284
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
285
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
286
- expect(x.function.id).to eq("LOG2")
287
- expect(x.parameters).to be_instance_of(Array)
288
- expect(x.parameters.count).to eq(1)
289
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
290
- expect(x.parameters[0].value).to eq(true)
291
- end
292
-
293
- constants.find{|x| x.id == "log10Expression"}.expression.tap do |x|
294
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
295
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
296
- expect(x.function.id).to eq("LOG10")
297
- expect(x.parameters).to be_instance_of(Array)
298
- expect(x.parameters.count).to eq(1)
299
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
300
- expect(x.parameters[0].value).to eq(true)
301
- end
302
-
303
- constants.find{|x| x.id == "nvlExpression"}.expression.tap do |x|
304
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
305
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
306
- expect(x.function.id).to eq("NVL")
307
- expect(x.parameters).to be_instance_of(Array)
308
- expect(x.parameters.count).to eq(1)
309
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
310
- expect(x.parameters[0].value).to eq(true)
311
- end
312
-
313
- constants.find{|x| x.id == "oddExpression"}.expression.tap do |x|
314
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
315
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
316
- expect(x.function.id).to eq("ODD")
317
- expect(x.parameters).to be_instance_of(Array)
318
- expect(x.parameters.count).to eq(1)
319
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
320
- expect(x.parameters[0].value).to eq(true)
321
- end
322
-
323
- constants.find{|x| x.id == "rolesofExpression"}.expression.tap do |x|
324
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
325
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
326
- expect(x.function.id).to eq("ROLESOF")
327
- expect(x.parameters).to be_instance_of(Array)
328
- expect(x.parameters.count).to eq(1)
329
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
330
- expect(x.parameters[0].value).to eq(true)
331
- end
332
-
333
- constants.find{|x| x.id == "sinExpression"}.expression.tap do |x|
334
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
335
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
336
- expect(x.function.id).to eq("SIN")
337
- expect(x.parameters).to be_instance_of(Array)
338
- expect(x.parameters.count).to eq(1)
339
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
340
- expect(x.parameters[0].value).to eq(true)
341
- end
342
-
343
- constants.find{|x| x.id == "sizeofExpression"}.expression.tap do |x|
344
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
345
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
346
- expect(x.function.id).to eq("SIZEOF")
347
- expect(x.parameters).to be_instance_of(Array)
348
- expect(x.parameters.count).to eq(1)
349
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
350
- expect(x.parameters[0].value).to eq(true)
351
- end
352
-
353
- constants.find{|x| x.id == "sqrtExpression"}.expression.tap do |x|
354
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
355
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
356
- expect(x.function.id).to eq("SQRT")
357
- expect(x.parameters).to be_instance_of(Array)
358
- expect(x.parameters.count).to eq(1)
359
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
360
- expect(x.parameters[0].value).to eq(true)
361
- end
362
-
363
- constants.find{|x| x.id == "tanExpression"}.expression.tap do |x|
364
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
365
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
366
- expect(x.function.id).to eq("TAN")
367
- expect(x.parameters).to be_instance_of(Array)
368
- expect(x.parameters.count).to eq(1)
369
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
370
- expect(x.parameters[0].value).to eq(true)
371
- end
372
-
373
- constants.find{|x| x.id == "typeofExpression"}.expression.tap do |x|
374
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
375
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
376
- expect(x.function.id).to eq("TYPEOF")
377
- expect(x.parameters).to be_instance_of(Array)
378
- expect(x.parameters.count).to eq(1)
379
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
380
- expect(x.parameters[0].value).to eq(true)
381
- end
382
-
383
- constants.find{|x| x.id == "usedinExpression"}.expression.tap do |x|
384
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
385
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
386
- expect(x.function.id).to eq("USEDIN")
387
- expect(x.parameters).to be_instance_of(Array)
388
- expect(x.parameters.count).to eq(1)
389
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
390
- expect(x.parameters[0].value).to eq(true)
391
- end
392
-
393
- constants.find{|x| x.id == "valueExpression"}.expression.tap do |x|
394
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
395
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
396
- expect(x.function.id).to eq("VALUE")
397
- expect(x.parameters).to be_instance_of(Array)
398
- expect(x.parameters.count).to eq(1)
399
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
400
- expect(x.parameters[0].value).to eq(true)
401
- end
402
-
403
- constants.find{|x| x.id == "valueInExpression"}.expression.tap do |x|
404
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
405
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
406
- expect(x.function.id).to eq("VALUE_IN")
407
- expect(x.parameters).to be_instance_of(Array)
408
- expect(x.parameters.count).to eq(1)
409
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
410
- expect(x.parameters[0].value).to eq(true)
411
- end
412
-
413
- constants.find{|x| x.id == "valueUniqueExpression"}.expression.tap do |x|
414
- expect(x).to be_instance_of(Expressir::Model::Expressions::FunctionCall)
415
- expect(x.function).to be_instance_of(Expressir::Model::Ref)
416
- expect(x.function.id).to eq("VALUE_UNIQUE")
417
- expect(x.parameters).to be_instance_of(Array)
418
- expect(x.parameters.count).to eq(1)
419
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
420
- expect(x.parameters[0].value).to eq(true)
421
- end
422
-
423
- # operations
424
- constants.find{|x| x.id == "unaryPlusExpression"}.expression.tap do |x|
425
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
426
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::UnaryPlus)
427
- expect(x.operands).to be_instance_of(Array)
428
- expect(x.operands.count).to eq(1)
429
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
430
- expect(x.operands[0].value).to eq("4")
431
- end
432
-
433
- constants.find{|x| x.id == "unaryMinusExpression"}.expression.tap do |x|
434
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
435
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::UnaryMinus)
436
- expect(x.operands).to be_instance_of(Array)
437
- expect(x.operands.count).to eq(1)
438
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
439
- expect(x.operands[0].value).to eq("4")
440
- end
441
-
442
- constants.find{|x| x.id == "additionExpression"}.expression.tap do |x|
443
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
444
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Addition)
445
- expect(x.operands).to be_instance_of(Array)
446
- expect(x.operands.count).to eq(2)
447
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
448
- expect(x.operands[0].value).to eq("4")
449
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
450
- expect(x.operands[1].value).to eq("2")
451
- end
452
-
453
- constants.find{|x| x.id == "subtractionExpression"}.expression.tap do |x|
454
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
455
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Subtraction)
456
- expect(x.operands).to be_instance_of(Array)
457
- expect(x.operands.count).to eq(2)
458
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
459
- expect(x.operands[0].value).to eq("4")
460
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
461
- expect(x.operands[1].value).to eq("2")
462
- end
463
-
464
- constants.find{|x| x.id == "multiplicationExpression"}.expression.tap do |x|
465
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
466
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Multiplication)
467
- expect(x.operands).to be_instance_of(Array)
468
- expect(x.operands.count).to eq(2)
469
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
470
- expect(x.operands[0].value).to eq("4")
471
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
472
- expect(x.operands[1].value).to eq("2")
473
- end
474
-
475
- constants.find{|x| x.id == "realDivisionExpression"}.expression.tap do |x|
476
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
477
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::RealDivision)
478
- expect(x.operands).to be_instance_of(Array)
479
- expect(x.operands.count).to eq(2)
480
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
481
- expect(x.operands[0].value).to eq("4")
482
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
483
- expect(x.operands[1].value).to eq("2")
484
- end
485
-
486
- constants.find{|x| x.id == "integerDivisionExpression"}.expression.tap do |x|
487
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
488
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::IntegerDivision)
489
- expect(x.operands).to be_instance_of(Array)
490
- expect(x.operands.count).to eq(2)
491
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
492
- expect(x.operands[0].value).to eq("4")
493
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
494
- expect(x.operands[1].value).to eq("2")
495
- end
496
-
497
- constants.find{|x| x.id == "moduloExpression"}.expression.tap do |x|
498
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
499
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Modulo)
500
- expect(x.operands).to be_instance_of(Array)
501
- expect(x.operands.count).to eq(2)
502
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
503
- expect(x.operands[0].value).to eq("4")
504
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
505
- expect(x.operands[1].value).to eq("2")
506
- end
507
-
508
- constants.find{|x| x.id == "exponentiationExpression"}.expression.tap do |x|
509
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
510
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Exponentiation)
511
- expect(x.operands).to be_instance_of(Array)
512
- expect(x.operands.count).to eq(2)
513
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
514
- expect(x.operands[0].value).to eq("4")
515
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
516
- expect(x.operands[1].value).to eq("2")
517
- end
518
-
519
- constants.find{|x| x.id == "additionAdditionExpression"}.expression.tap do |x|
520
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
521
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Addition)
522
- expect(x.operands).to be_instance_of(Array)
523
- expect(x.operands.count).to eq(2)
524
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
525
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Addition)
526
- expect(x.operands[0].operands).to be_instance_of(Array)
527
- expect(x.operands[0].operands.count).to eq(2)
528
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
529
- expect(x.operands[0].operands[0].value).to eq("4")
530
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
531
- expect(x.operands[0].operands[1].value).to eq("2")
532
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
533
- expect(x.operands[1].value).to eq("1")
534
- end
535
-
536
- constants.find{|x| x.id == "subtractionSubtractionExpression"}.expression.tap do |x|
537
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
538
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Subtraction)
539
- expect(x.operands).to be_instance_of(Array)
540
- expect(x.operands.count).to eq(2)
541
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
542
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Subtraction)
543
- expect(x.operands[0].operands).to be_instance_of(Array)
544
- expect(x.operands[0].operands.count).to eq(2)
545
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
546
- expect(x.operands[0].operands[0].value).to eq("4")
547
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
548
- expect(x.operands[0].operands[1].value).to eq("2")
549
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
550
- expect(x.operands[1].value).to eq("1")
551
- end
552
-
553
- constants.find{|x| x.id == "additionSubtractionExpression"}.expression.tap do |x|
554
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
555
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Subtraction)
556
- expect(x.operands).to be_instance_of(Array)
557
- expect(x.operands.count).to eq(2)
558
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
559
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Addition)
560
- expect(x.operands[0].operands).to be_instance_of(Array)
561
- expect(x.operands[0].operands.count).to eq(2)
562
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
563
- expect(x.operands[0].operands[0].value).to eq("4")
564
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
565
- expect(x.operands[0].operands[1].value).to eq("2")
566
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
567
- expect(x.operands[1].value).to eq("1")
568
- end
569
-
570
- constants.find{|x| x.id == "subtractionAdditionExpression"}.expression.tap do |x|
571
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
572
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Addition)
573
- expect(x.operands).to be_instance_of(Array)
574
- expect(x.operands.count).to eq(2)
575
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
576
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Subtraction)
577
- expect(x.operands[0].operands).to be_instance_of(Array)
578
- expect(x.operands[0].operands.count).to eq(2)
579
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
580
- expect(x.operands[0].operands[0].value).to eq("4")
581
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
582
- expect(x.operands[0].operands[1].value).to eq("2")
583
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
584
- expect(x.operands[1].value).to eq("1")
585
- end
586
-
587
- constants.find{|x| x.id == "additionMultiplicationExpression"}.expression.tap do |x|
588
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
589
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Addition)
590
- expect(x.operands).to be_instance_of(Array)
591
- expect(x.operands.count).to eq(2)
592
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
593
- expect(x.operands[0].value).to eq("8")
594
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
595
- expect(x.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Multiplication)
596
- expect(x.operands[1].operands).to be_instance_of(Array)
597
- expect(x.operands[1].operands.count).to eq(2)
598
- expect(x.operands[1].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
599
- expect(x.operands[1].operands[0].value).to eq("4")
600
- expect(x.operands[1].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
601
- expect(x.operands[1].operands[1].value).to eq("2")
602
- end
603
-
604
- constants.find{|x| x.id == "multiplicationAdditionExpression"}.expression.tap do |x|
605
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
606
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Addition)
607
- expect(x.operands).to be_instance_of(Array)
608
- expect(x.operands.count).to eq(2)
609
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
610
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Multiplication)
611
- expect(x.operands[0].operands).to be_instance_of(Array)
612
- expect(x.operands[0].operands.count).to eq(2)
613
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
614
- expect(x.operands[0].operands[0].value).to eq("8")
615
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
616
- expect(x.operands[0].operands[1].value).to eq("4")
617
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
618
- expect(x.operands[1].value).to eq("2")
619
- end
620
-
621
- constants.find{|x| x.id == "parenthesisAdditionMultiplicationExpression"}.expression.tap do |x|
622
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
623
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Multiplication)
624
- expect(x.operands).to be_instance_of(Array)
625
- expect(x.operands.count).to eq(2)
626
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
627
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Addition)
628
- expect(x.operands[0].operands).to be_instance_of(Array)
629
- expect(x.operands[0].operands.count).to eq(2)
630
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
631
- expect(x.operands[0].operands[0].value).to eq("8")
632
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
633
- expect(x.operands[0].operands[1].value).to eq("4")
634
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
635
- expect(x.operands[1].value).to eq("2")
636
- end
637
-
638
- constants.find{|x| x.id == "multiplicationParenthesisAdditionExpression"}.expression.tap do |x|
639
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
640
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Multiplication)
641
- expect(x.operands).to be_instance_of(Array)
642
- expect(x.operands.count).to eq(2)
643
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
644
- expect(x.operands[0].value).to eq("8")
645
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
646
- expect(x.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Addition)
647
- expect(x.operands[1].operands).to be_instance_of(Array)
648
- expect(x.operands[1].operands.count).to eq(2)
649
- expect(x.operands[1].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
650
- expect(x.operands[1].operands[0].value).to eq("4")
651
- expect(x.operands[1].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
652
- expect(x.operands[1].operands[1].value).to eq("2")
653
- end
654
-
655
- constants.find{|x| x.id == "equalExpression"}.expression.tap do |x|
656
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
657
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Equal)
658
- expect(x.operands).to be_instance_of(Array)
659
- expect(x.operands.count).to eq(2)
660
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
661
- expect(x.operands[0].value).to eq("4")
662
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
663
- expect(x.operands[1].value).to eq("2")
664
- end
665
-
666
- constants.find{|x| x.id == "notEqualExpression"}.expression.tap do |x|
667
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
668
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::NotEqual)
669
- expect(x.operands).to be_instance_of(Array)
670
- expect(x.operands.count).to eq(2)
671
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
672
- expect(x.operands[0].value).to eq("4")
673
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
674
- expect(x.operands[1].value).to eq("2")
675
- end
676
-
677
- constants.find{|x| x.id == "ltExpression"}.expression.tap do |x|
678
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
679
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::LessThan)
680
- expect(x.operands).to be_instance_of(Array)
681
- expect(x.operands.count).to eq(2)
682
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
683
- expect(x.operands[0].value).to eq("4")
684
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
685
- expect(x.operands[1].value).to eq("2")
686
- end
687
-
688
- constants.find{|x| x.id == "gtExpression"}.expression.tap do |x|
689
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
690
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::GreaterThan)
691
- expect(x.operands).to be_instance_of(Array)
692
- expect(x.operands.count).to eq(2)
693
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
694
- expect(x.operands[0].value).to eq("4")
695
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
696
- expect(x.operands[1].value).to eq("2")
697
- end
698
-
699
- constants.find{|x| x.id == "lteExpression"}.expression.tap do |x|
700
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
701
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::LessThanOrEqual)
702
- expect(x.operands).to be_instance_of(Array)
703
- expect(x.operands.count).to eq(2)
704
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
705
- expect(x.operands[0].value).to eq("4")
706
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
707
- expect(x.operands[1].value).to eq("2")
708
- end
709
-
710
- constants.find{|x| x.id == "gteExpression"}.expression.tap do |x|
711
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
712
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::GreaterThanOrEqual)
713
- expect(x.operands).to be_instance_of(Array)
714
- expect(x.operands.count).to eq(2)
715
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
716
- expect(x.operands[0].value).to eq("4")
717
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
718
- expect(x.operands[1].value).to eq("2")
719
- end
720
-
721
- constants.find{|x| x.id == "orExpression"}.expression.tap do |x|
722
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
723
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Or)
724
- expect(x.operands).to be_instance_of(Array)
725
- expect(x.operands.count).to eq(2)
726
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
727
- expect(x.operands[0].value).to eq(true)
728
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
729
- expect(x.operands[1].value).to eq(false)
730
- end
731
-
732
- constants.find{|x| x.id == "andExpression"}.expression.tap do |x|
733
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
734
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::And)
735
- expect(x.operands).to be_instance_of(Array)
736
- expect(x.operands.count).to eq(2)
737
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
738
- expect(x.operands[0].value).to eq(true)
739
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
740
- expect(x.operands[1].value).to eq(false)
741
- end
742
-
743
- constants.find{|x| x.id == "orOrExpression"}.expression.tap do |x|
744
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
745
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Or)
746
- expect(x.operands).to be_instance_of(Array)
747
- expect(x.operands.count).to eq(2)
748
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
749
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Or)
750
- expect(x.operands[0].operands).to be_instance_of(Array)
751
- expect(x.operands[0].operands.count).to eq(2)
752
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
753
- expect(x.operands[0].operands[0].value).to eq(true)
754
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
755
- expect(x.operands[0].operands[1].value).to eq(false)
756
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
757
- expect(x.operands[1].value).to eq(true)
758
- end
759
-
760
- constants.find{|x| x.id == "andAndExpression"}.expression.tap do |x|
761
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
762
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::And)
763
- expect(x.operands).to be_instance_of(Array)
764
- expect(x.operands.count).to eq(2)
765
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
766
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::And)
767
- expect(x.operands[0].operands).to be_instance_of(Array)
768
- expect(x.operands[0].operands.count).to eq(2)
769
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
770
- expect(x.operands[0].operands[0].value).to eq(true)
771
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
772
- expect(x.operands[0].operands[1].value).to eq(false)
773
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
774
- expect(x.operands[1].value).to eq(true)
775
- end
776
-
777
- constants.find{|x| x.id == "orAndExpression"}.expression.tap do |x|
778
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
779
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Or)
780
- expect(x.operands).to be_instance_of(Array)
781
- expect(x.operands.count).to eq(2)
782
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
783
- expect(x.operands[0].value).to eq(true)
784
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
785
- expect(x.operands[1].operator).to be_instance_of(Expressir::Model::Operators::And)
786
- expect(x.operands[1].operands).to be_instance_of(Array)
787
- expect(x.operands[1].operands.count).to eq(2)
788
- expect(x.operands[1].operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
789
- expect(x.operands[1].operands[0].value).to eq(false)
790
- expect(x.operands[1].operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
791
- expect(x.operands[1].operands[1].value).to eq(true)
792
- end
793
-
794
- constants.find{|x| x.id == "andOrExpression"}.expression.tap do |x|
795
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
796
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Or)
797
- expect(x.operands).to be_instance_of(Array)
798
- expect(x.operands.count).to eq(2)
799
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
800
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::And)
801
- expect(x.operands[0].operands).to be_instance_of(Array)
802
- expect(x.operands[0].operands.count).to eq(2)
803
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
804
- expect(x.operands[0].operands[0].value).to eq(true)
805
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
806
- expect(x.operands[0].operands[1].value).to eq(false)
807
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
808
- expect(x.operands[1].value).to eq(true)
809
- end
810
-
811
- constants.find{|x| x.id == "parenthesisOrAndExpression"}.expression.tap do |x|
812
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
813
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::And)
814
- expect(x.operands).to be_instance_of(Array)
815
- expect(x.operands.count).to eq(2)
816
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
817
- expect(x.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Or)
818
- expect(x.operands[0].operands).to be_instance_of(Array)
819
- expect(x.operands[0].operands.count).to eq(2)
820
- expect(x.operands[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
821
- expect(x.operands[0].operands[0].value).to eq(true)
822
- expect(x.operands[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
823
- expect(x.operands[0].operands[1].value).to eq(false)
824
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
825
- expect(x.operands[1].value).to eq(true)
826
- end
827
-
828
- constants.find{|x| x.id == "andParenthesisOrExpression"}.expression.tap do |x|
829
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
830
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::And)
831
- expect(x.operands).to be_instance_of(Array)
832
- expect(x.operands.count).to eq(2)
833
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
834
- expect(x.operands[0].value).to eq(true)
835
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
836
- expect(x.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Or)
837
- expect(x.operands[1].operands).to be_instance_of(Array)
838
- expect(x.operands[1].operands.count).to eq(2)
839
- expect(x.operands[1].operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
840
- expect(x.operands[1].operands[0].value).to eq(false)
841
- expect(x.operands[1].operands[1]).to be_instance_of(Expressir::Model::Literals::Logical)
842
- expect(x.operands[1].operands[1].value).to eq(true)
843
- end
844
-
845
- # aggregate initializers
846
- constants.find{|x| x.id == "aggregateInitializerExpression"}.expression.tap do |x|
847
- expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
848
- expect(x.items).to be_instance_of(Array)
849
- expect(x.items.count).to eq(1)
850
- expect(x.items[0]).to be_instance_of(Expressir::Model::Literals::String)
851
- expect(x.items[0].value).to eq("xxx")
852
- end
853
-
854
- constants.find{|x| x.id == "repeatedAggregateInitializerExpression"}.expression.tap do |x|
855
- expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
856
- expect(x.items).to be_instance_of(Array)
857
- expect(x.items.count).to eq(1)
858
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::AggregateElement)
859
- expect(x.items[0].expression).to be_instance_of(Expressir::Model::Literals::String)
860
- expect(x.items[0].expression.value).to eq("xxx")
861
- expect(x.items[0].repetition).to be_instance_of(Expressir::Model::Literals::Integer)
862
- expect(x.items[0].repetition.value).to eq("2")
863
- end
864
-
865
- constants.find{|x| x.id == "complexAggregateInitializerExpression"}.expression.tap do |x|
866
- expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
867
- expect(x.items).to be_instance_of(Array)
868
- expect(x.items.count).to eq(1)
869
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
870
- expect(x.items[0].operator).to be_instance_of(Expressir::Model::Operators::Addition)
871
- expect(x.items[0].operands).to be_instance_of(Array)
872
- expect(x.items[0].operands.count).to eq(2)
873
- expect(x.items[0].operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
874
- expect(x.items[0].operands[0].value).to eq("4")
875
- expect(x.items[0].operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
876
- expect(x.items[0].operands[1].value).to eq("2")
877
- end
878
-
879
- constants.find{|x| x.id == "complexRepeatedAggregateInitializerExpression"}.expression.tap do |x|
880
- expect(x).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
881
- expect(x.items).to be_instance_of(Array)
882
- expect(x.items.count).to eq(1)
883
- expect(x.items[0]).to be_instance_of(Expressir::Model::Expressions::AggregateElement)
884
- expect(x.items[0].expression).to be_instance_of(Expressir::Model::Expressions::Expression)
885
- expect(x.items[0].expression.operator).to be_instance_of(Expressir::Model::Operators::Addition)
886
- expect(x.items[0].expression.operands).to be_instance_of(Array)
887
- expect(x.items[0].expression.operands.count).to eq(2)
888
- expect(x.items[0].expression.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
889
- expect(x.items[0].expression.operands[0].value).to eq("4")
890
- expect(x.items[0].expression.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
891
- expect(x.items[0].expression.operands[1].value).to eq("2")
892
- expect(x.items[0].repetition).to be_instance_of(Expressir::Model::Expressions::Expression)
893
- expect(x.items[0].repetition.operator).to be_instance_of(Expressir::Model::Operators::Addition)
894
- expect(x.items[0].repetition.operands).to be_instance_of(Array)
895
- expect(x.items[0].repetition.operands.count).to eq(2)
896
- expect(x.items[0].repetition.operands[0]).to be_instance_of(Expressir::Model::Literals::Integer)
897
- expect(x.items[0].repetition.operands[0].value).to eq("4")
898
- expect(x.items[0].repetition.operands[1]).to be_instance_of(Expressir::Model::Literals::Integer)
899
- expect(x.items[0].repetition.operands[1].value).to eq("2")
900
- end
901
-
902
- # entity constructors
903
- constants.find{|x| x.id == "entityConstructorExpression"}.expression.tap do |x|
904
- expect(x).to be_instance_of(Expressir::Model::Expressions::EntityConstructor)
905
- expect(x.entity).to be_instance_of(Expressir::Model::Ref)
906
- expect(x.entity.id).to eq("explicitAttributeEntity")
907
- expect(x.parameters).to be_instance_of(Array)
908
- expect(x.parameters.count).to eq(1)
909
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
910
- expect(x.parameters[0].value).to eq(true)
911
- end
912
-
913
- # enumeration references
914
- constants.find{|x| x.id == "enumerationReferenceExpression"}.expression.tap do |x|
915
- expect(x).to be_instance_of(Expressir::Model::Ref)
916
- expect(x.id).to eq("test")
917
- end
918
-
919
- constants.find{|x| x.id == "attributeEnumerationReferenceExpression"}.expression.tap do |x|
920
- expect(x).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
921
- expect(x.ref).to be_instance_of(Expressir::Model::Ref)
922
- expect(x.ref.id).to eq("test")
923
- expect(x.qualifiers).to be_instance_of(Array)
924
- expect(x.qualifiers.count).to eq(1)
925
- expect(x.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
926
- expect(x.qualifiers[0].attribute).to be_instance_of(Expressir::Model::Ref)
927
- expect(x.qualifiers[0].attribute.id).to eq("test")
928
- end
929
-
930
- # intervals
931
- constants.find{|x| x.id == "ltLtIntervalExpression"}.expression.tap do |x|
932
- expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
933
- expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
934
- expect(x.low.value).to eq("1")
935
- expect(x.operator1).to be_instance_of(Expressir::Model::Operators::LessThan)
936
- expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
937
- expect(x.item.value).to eq("5")
938
- expect(x.operator2).to be_instance_of(Expressir::Model::Operators::LessThan)
939
- expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
940
- expect(x.high.value).to eq("9")
941
- end
942
-
943
- constants.find{|x| x.id == "lteLtIntervalExpression"}.expression.tap do |x|
944
- expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
945
- expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
946
- expect(x.low.value).to eq("1")
947
- expect(x.operator1).to be_instance_of(Expressir::Model::Operators::LessThanOrEqual)
948
- expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
949
- expect(x.item.value).to eq("5")
950
- expect(x.operator2).to be_instance_of(Expressir::Model::Operators::LessThan)
951
- expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
952
- expect(x.high.value).to eq("9")
953
- end
954
-
955
- constants.find{|x| x.id == "ltLteIntervalExpression"}.expression.tap do |x|
956
- expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
957
- expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
958
- expect(x.low.value).to eq("1")
959
- expect(x.operator1).to be_instance_of(Expressir::Model::Operators::LessThan)
960
- expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
961
- expect(x.item.value).to eq("5")
962
- expect(x.operator2).to be_instance_of(Expressir::Model::Operators::LessThanOrEqual)
963
- expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
964
- expect(x.high.value).to eq("9")
965
- end
966
-
967
- constants.find{|x| x.id == "lteLteIntervalExpression"}.expression.tap do |x|
968
- expect(x).to be_instance_of(Expressir::Model::Expressions::Interval)
969
- expect(x.low).to be_instance_of(Expressir::Model::Literals::Integer)
970
- expect(x.low.value).to eq("1")
971
- expect(x.operator1).to be_instance_of(Expressir::Model::Operators::LessThanOrEqual)
972
- expect(x.item).to be_instance_of(Expressir::Model::Literals::Integer)
973
- expect(x.item.value).to eq("5")
974
- expect(x.operator2).to be_instance_of(Expressir::Model::Operators::LessThanOrEqual)
975
- expect(x.high).to be_instance_of(Expressir::Model::Literals::Integer)
976
- expect(x.high.value).to eq("9")
977
- end
978
-
979
- constants.find{|x| x.id == "combineExpression"}.expression.tap do |x|
980
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
981
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Combine)
982
- expect(x.operands).to be_instance_of(Array)
983
- expect(x.operands.count).to eq(2)
984
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Ref)
985
- expect(x.operands[0].id).to eq("test")
986
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Ref)
987
- expect(x.operands[1].id).to eq("test")
988
- end
989
-
990
- constants.find{|x| x.id == "inExpression"}.expression.tap do |x|
991
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
992
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::In)
993
- expect(x.operands).to be_instance_of(Array)
994
- expect(x.operands.count).to eq(2)
995
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::Logical)
996
- expect(x.operands[0].value).to eq(true)
997
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Expressions::AggregateInitializer)
998
- expect(x.operands[1].items).to be_instance_of(Array)
999
- expect(x.operands[1].items.count).to eq(1)
1000
- expect(x.operands[1].items[0]).to be_instance_of(Expressir::Model::Literals::Logical)
1001
- expect(x.operands[1].items[0].value).to eq(true)
1002
- end
1003
-
1004
- constants.find{|x| x.id == "likeExpression"}.expression.tap do |x|
1005
- expect(x).to be_instance_of(Expressir::Model::Expressions::Expression)
1006
- expect(x.operator).to be_instance_of(Expressir::Model::Operators::Like)
1007
- expect(x.operands).to be_instance_of(Array)
1008
- expect(x.operands.count).to eq(2)
1009
- expect(x.operands[0]).to be_instance_of(Expressir::Model::Literals::String)
1010
- expect(x.operands[0].value).to eq("xxx")
1011
- expect(x.operands[1]).to be_instance_of(Expressir::Model::Literals::String)
1012
- expect(x.operands[1].value).to eq("xxx")
1013
- end
1014
-
1015
- # queries
1016
- constants.find{|x| x.id == "queryExpression"}.expression.tap do |x|
1017
- expect(x).to be_instance_of(Expressir::Model::Expressions::Query)
1018
- expect(x.id).to eq("test")
1019
- expect(x.source).to be_instance_of(Expressir::Model::Ref)
1020
- expect(x.source.id).to eq("test2")
1021
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
1022
- expect(x.expression.value).to eq(true)
1023
- end
1024
-
1025
- # types
1026
- types.find{|x| x.id == "integerType"}.tap do |x|
1027
- expect(x).to be_instance_of(Expressir::Model::Type)
1028
- expect(x.type).to be_instance_of(Expressir::Model::Types::Integer)
1029
- end
1030
-
1031
- types.find{|x| x.id == "integerWhereType"}.tap do |x|
1032
- expect(x).to be_instance_of(Expressir::Model::Type)
1033
- expect(x.type).to be_instance_of(Expressir::Model::Types::Integer)
1034
- expect(x.where).to be_instance_of(Array)
1035
- expect(x.where.count).to eq(1)
1036
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1037
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1038
- expect(x.where[0].expression.value).to eq(true)
1039
- end
1040
-
1041
- types.find{|x| x.id == "integerWhereLabelType"}.tap do |x|
1042
- expect(x).to be_instance_of(Expressir::Model::Type)
1043
- expect(x.type).to be_instance_of(Expressir::Model::Types::Integer)
1044
- expect(x.where).to be_instance_of(Array)
1045
- expect(x.where.count).to eq(1)
1046
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1047
- expect(x.where[0].id).to eq("WR1")
1048
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1049
- expect(x.where[0].expression.value).to eq(true)
1050
- end
1051
-
1052
- # simple types
1053
- types.find{|x| x.id == "binaryType"}.type.tap do |x|
1054
- expect(x).to be_instance_of(Expressir::Model::Types::Binary)
1055
- end
1056
-
1057
- types.find{|x| x.id == "binaryWidthType"}.type.tap do |x|
1058
- expect(x).to be_instance_of(Expressir::Model::Types::Binary)
1059
- expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1060
- expect(x.width.value).to eq("3")
1061
- end
1062
-
1063
- types.find{|x| x.id == "binaryWidthFixedType"}.type.tap do |x|
1064
- expect(x).to be_instance_of(Expressir::Model::Types::Binary)
1065
- expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1066
- expect(x.width.value).to eq("3")
1067
- expect(x.fixed).to eq(true)
1068
- end
1069
-
1070
- types.find{|x| x.id == "booleanType"}.type.tap do |x|
1071
- expect(x).to be_instance_of(Expressir::Model::Types::Boolean)
1072
- end
1073
-
1074
- types.find{|x| x.id == "integerType"}.type.tap do |x|
1075
- expect(x).to be_instance_of(Expressir::Model::Types::Integer)
1076
- end
1077
-
1078
- types.find{|x| x.id == "logicalType"}.type.tap do |x|
1079
- expect(x).to be_instance_of(Expressir::Model::Types::Logical)
1080
- end
1081
-
1082
- types.find{|x| x.id == "numberType"}.type.tap do |x|
1083
- expect(x).to be_instance_of(Expressir::Model::Types::Number)
1084
- end
1085
-
1086
- types.find{|x| x.id == "realType"}.type.tap do |x|
1087
- expect(x).to be_instance_of(Expressir::Model::Types::Real)
1088
- end
1089
-
1090
- types.find{|x| x.id == "realPrecisionType"}.type.tap do |x|
1091
- expect(x).to be_instance_of(Expressir::Model::Types::Real)
1092
- expect(x.precision).to be_instance_of(Expressir::Model::Literals::Integer)
1093
- expect(x.precision.value).to eq("3")
1094
- end
1095
-
1096
- types.find{|x| x.id == "stringType"}.type.tap do |x|
1097
- expect(x).to be_instance_of(Expressir::Model::Types::String)
1098
- end
1099
-
1100
- types.find{|x| x.id == "stringWidthType"}.type.tap do |x|
1101
- expect(x).to be_instance_of(Expressir::Model::Types::String)
1102
- expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1103
- expect(x.width.value).to eq("3")
1104
- end
1105
-
1106
- types.find{|x| x.id == "stringWidthFixedType"}.type.tap do |x|
1107
- expect(x).to be_instance_of(Expressir::Model::Types::String)
1108
- expect(x.width).to be_instance_of(Expressir::Model::Literals::Integer)
1109
- expect(x.width.value).to eq("3")
1110
- expect(x.fixed).to eq(true)
1111
- end
1112
-
1113
- # aggregation types
1114
- types.find{|x| x.id == "arrayType"}.type.tap do |x|
1115
- expect(x).to be_instance_of(Expressir::Model::Types::Array)
1116
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1117
- expect(x.bound1.value).to eq("1")
1118
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1119
- expect(x.bound2.value).to eq("9")
1120
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1121
- end
1122
-
1123
- types.find{|x| x.id == "arrayOptionalType"}.type.tap do |x|
1124
- expect(x).to be_instance_of(Expressir::Model::Types::Array)
1125
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1126
- expect(x.bound1.value).to eq("1")
1127
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1128
- expect(x.bound2.value).to eq("9")
1129
- expect(x.optional).to eq(true)
1130
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1131
- end
1132
-
1133
- types.find{|x| x.id == "arrayUniqueType"}.type.tap do |x|
1134
- expect(x).to be_instance_of(Expressir::Model::Types::Array)
1135
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1136
- expect(x.bound1.value).to eq("1")
1137
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1138
- expect(x.bound2.value).to eq("9")
1139
- expect(x.unique).to eq(true)
1140
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1141
- end
1142
-
1143
- types.find{|x| x.id == "arrayOptionalUniqueType"}.type.tap do |x|
1144
- expect(x).to be_instance_of(Expressir::Model::Types::Array)
1145
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1146
- expect(x.bound1.value).to eq("1")
1147
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1148
- expect(x.bound2.value).to eq("9")
1149
- expect(x.optional).to eq(true)
1150
- expect(x.unique).to eq(true)
1151
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1152
- end
1153
-
1154
- types.find{|x| x.id == "bagType"}.type.tap do |x|
1155
- expect(x).to be_instance_of(Expressir::Model::Types::Bag)
1156
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1157
- end
1158
-
1159
- types.find{|x| x.id == "bagBoundType"}.type.tap do |x|
1160
- expect(x).to be_instance_of(Expressir::Model::Types::Bag)
1161
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1162
- expect(x.bound1.value).to eq("1")
1163
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1164
- expect(x.bound2.value).to eq("9")
1165
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1166
- end
1167
-
1168
- types.find{|x| x.id == "listType"}.type.tap do |x|
1169
- expect(x).to be_instance_of(Expressir::Model::Types::List)
1170
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1171
- end
1172
-
1173
- types.find{|x| x.id == "listBoundType"}.type.tap do |x|
1174
- expect(x).to be_instance_of(Expressir::Model::Types::List)
1175
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1176
- expect(x.bound1.value).to eq("1")
1177
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1178
- expect(x.bound2.value).to eq("9")
1179
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1180
- end
1181
-
1182
- types.find{|x| x.id == "listUniqueType"}.type.tap do |x|
1183
- expect(x).to be_instance_of(Expressir::Model::Types::List)
1184
- expect(x.unique).to eq(true)
1185
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1186
- end
1187
-
1188
- types.find{|x| x.id == "listBoundUniqueType"}.type.tap do |x|
1189
- expect(x).to be_instance_of(Expressir::Model::Types::List)
1190
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1191
- expect(x.bound1.value).to eq("1")
1192
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1193
- expect(x.bound2.value).to eq("9")
1194
- expect(x.unique).to eq(true)
1195
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1196
- end
1197
-
1198
- types.find{|x| x.id == "setType"}.type.tap do |x|
1199
- expect(x).to be_instance_of(Expressir::Model::Types::Set)
1200
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1201
- end
1202
-
1203
- types.find{|x| x.id == "setBoundType"}.type.tap do |x|
1204
- expect(x).to be_instance_of(Expressir::Model::Types::Set)
1205
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1206
- expect(x.bound1.value).to eq("1")
1207
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1208
- expect(x.bound2.value).to eq("9")
1209
- expect(x.base_type).to be_instance_of(Expressir::Model::Types::String)
1210
- end
1211
-
1212
- # constructed types
1213
- types.find{|x| x.id == "selectType"}.type.tap do |x|
1214
- expect(x).to be_instance_of(Expressir::Model::Types::Select)
1215
- end
1216
-
1217
- types.find{|x| x.id == "selectExtensibleType"}.type.tap do |x|
1218
- expect(x).to be_instance_of(Expressir::Model::Types::Select)
1219
- expect(x.extensible).to eq(true)
1220
- end
1221
-
1222
- types.find{|x| x.id == "selectExtensibleGenericEntityType"}.type.tap do |x|
1223
- expect(x).to be_instance_of(Expressir::Model::Types::Select)
1224
- expect(x.extensible).to eq(true)
1225
- expect(x.generic_entity).to eq(true)
1226
- end
1227
-
1228
- types.find{|x| x.id == "selectListType"}.type.tap do |x|
1229
- expect(x).to be_instance_of(Expressir::Model::Types::Select)
1230
- expect(x.items).to be_instance_of(Array)
1231
- expect(x.items.count).to eq(1)
1232
- expect(x.items[0]).to be_instance_of(Expressir::Model::Ref)
1233
- expect(x.items[0].id).to eq("test")
1234
- end
1235
-
1236
- types.find{|x| x.id == "selectExtensionTypeRefType"}.type.tap do |x|
1237
- expect(x).to be_instance_of(Expressir::Model::Types::Select)
1238
- expect(x.extension_type).to be_instance_of(Expressir::Model::Ref)
1239
- expect(x.extension_type.id).to eq("selectType")
1240
- end
1241
-
1242
- types.find{|x| x.id == "selectExtensionTypeRefListType"}.type.tap do |x|
1243
- expect(x).to be_instance_of(Expressir::Model::Types::Select)
1244
- expect(x.extension_type).to be_instance_of(Expressir::Model::Ref)
1245
- expect(x.extension_type.id).to eq("selectType")
1246
- expect(x.extension_items).to be_instance_of(Array)
1247
- expect(x.extension_items.count).to eq(1)
1248
- expect(x.extension_items[0]).to be_instance_of(Expressir::Model::Ref)
1249
- expect(x.extension_items[0].id).to eq("test")
1250
- end
1251
-
1252
- types.find{|x| x.id == "enumerationType"}.type.tap do |x|
1253
- expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1254
- end
1255
-
1256
- types.find{|x| x.id == "enumerationExtensibleType"}.type.tap do |x|
1257
- expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1258
- expect(x.extensible).to eq(true)
1259
- end
1260
-
1261
- types.find{|x| x.id == "enumerationListType"}.type.tap do |x|
1262
- expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1263
- expect(x.items).to be_instance_of(Array)
1264
- expect(x.items.count).to eq(1)
1265
- expect(x.items[0]).to be_instance_of(Expressir::Model::EnumerationItem)
1266
- expect(x.items[0].id).to eq("test")
1267
- end
1268
-
1269
- types.find{|x| x.id == "enumerationExtensionTypeRefType"}.type.tap do |x|
1270
- expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1271
- expect(x.extension_type).to be_instance_of(Expressir::Model::Ref)
1272
- expect(x.extension_type.id).to eq("enumerationType")
1273
- end
1274
-
1275
- types.find{|x| x.id == "enumerationExtensionTypeRefListType"}.type.tap do |x|
1276
- expect(x).to be_instance_of(Expressir::Model::Types::Enumeration)
1277
- expect(x.extension_type).to be_instance_of(Expressir::Model::Ref)
1278
- expect(x.extension_type.id).to eq("enumerationType")
1279
- expect(x.extension_items).to be_instance_of(Array)
1280
- expect(x.extension_items[0]).to be_instance_of(Expressir::Model::EnumerationItem)
1281
- expect(x.extension_items[0].id).to eq("test")
1282
- end
1283
-
1284
- # entities
1285
- entities.find{|x| x.id == "emptyEntity"}.tap do |x|
1286
- expect(x).to be_instance_of(Expressir::Model::Entity)
1287
- end
1288
-
1289
- entities.find{|x| x.id == "abstractEntity"}.tap do |x|
1290
- expect(x).to be_instance_of(Expressir::Model::Entity)
1291
- expect(x.abstract).to eq(true)
1292
- end
1293
-
1294
- entities.find{|x| x.id == "abstractSupertypeEntity"}.tap do |x|
1295
- expect(x).to be_instance_of(Expressir::Model::Entity)
1296
- expect(x.abstract_supertype).to eq(true)
1297
- end
1298
-
1299
- entities.find{|x| x.id == "abstractSupertypeConstraintEntity"}.tap do |x|
1300
- expect(x).to be_instance_of(Expressir::Model::Entity)
1301
- expect(x.abstract_supertype).to eq(true)
1302
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Ref)
1303
- expect(x.subtype_expression.id).to eq("emptyEntity")
1304
- end
1305
-
1306
- entities.find{|x| x.id == "supertypeConstraintEntity"}.tap do |x|
1307
- expect(x).to be_instance_of(Expressir::Model::Entity)
1308
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Ref)
1309
- expect(x.subtype_expression.id).to eq("emptyEntity")
1310
- end
1311
-
1312
- entities.find{|x| x.id == "subtypeEntity"}.tap do |x|
1313
- expect(x).to be_instance_of(Expressir::Model::Entity)
1314
- expect(x.supertypes).to be_instance_of(Array)
1315
- expect(x.supertypes.count).to eq(1)
1316
- expect(x.supertypes[0]).to be_instance_of(Expressir::Model::Ref)
1317
- expect(x.supertypes[0].id).to eq("emptyEntity")
1318
- end
1319
-
1320
- entities.find{|x| x.id == "supertypeConstraintSubtypeEntity"}.tap do |x|
1321
- expect(x).to be_instance_of(Expressir::Model::Entity)
1322
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Ref)
1323
- expect(x.subtype_expression.id).to eq("emptyEntity")
1324
- expect(x.supertypes).to be_instance_of(Array)
1325
- expect(x.supertypes.count).to eq(1)
1326
- expect(x.supertypes[0]).to be_instance_of(Expressir::Model::Ref)
1327
- expect(x.supertypes[0].id).to eq("emptyEntity")
1328
- end
1329
-
1330
- entities.find{|x| x.id == "explicitAttributeEntity"}.tap do |x|
1331
- expect(x).to be_instance_of(Expressir::Model::Entity)
1332
- expect(x.explicit).to be_instance_of(Array)
1333
- expect(x.explicit.count).to eq(1)
1334
- expect(x.explicit[0]).to be_instance_of(Expressir::Model::Explicit)
1335
- expect(x.explicit[0].id).to eq("test")
1336
- expect(x.explicit[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1337
- end
1338
-
1339
- entities.find{|x| x.id == "explicitAttributeOptionalEntity"}.tap do |x|
1340
- expect(x).to be_instance_of(Expressir::Model::Entity)
1341
- expect(x.explicit).to be_instance_of(Array)
1342
- expect(x.explicit.count).to eq(1)
1343
- expect(x.explicit[0]).to be_instance_of(Expressir::Model::Explicit)
1344
- expect(x.explicit[0].id).to eq("test")
1345
- expect(x.explicit[0].optional).to eq(true)
1346
- expect(x.explicit[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1347
- end
1348
-
1349
- entities.find{|x| x.id == "explicitAttributeMultipleEntity"}.tap do |x|
1350
- expect(x).to be_instance_of(Expressir::Model::Entity)
1351
- expect(x.explicit).to be_instance_of(Array)
1352
- expect(x.explicit.count).to eq(2)
1353
- expect(x.explicit[0]).to be_instance_of(Expressir::Model::Explicit)
1354
- expect(x.explicit[0].id).to eq("test")
1355
- expect(x.explicit[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1356
- expect(x.explicit[1]).to be_instance_of(Expressir::Model::Explicit)
1357
- expect(x.explicit[1].id).to eq("test2")
1358
- expect(x.explicit[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1359
- end
1360
-
1361
- entities.find{|x| x.id == "explicitAttributeMultipleShorthandEntity"}.tap do |x|
1362
- expect(x).to be_instance_of(Expressir::Model::Entity)
1363
- expect(x.explicit).to be_instance_of(Array)
1364
- expect(x.explicit.count).to eq(2)
1365
- expect(x.explicit[0]).to be_instance_of(Expressir::Model::Explicit)
1366
- expect(x.explicit[0].id).to eq("test")
1367
- expect(x.explicit[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1368
- expect(x.explicit[1]).to be_instance_of(Expressir::Model::Explicit)
1369
- expect(x.explicit[1].id).to eq("test2")
1370
- expect(x.explicit[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
1371
- end
1372
-
1373
- entities.find{|x| x.id == "explicitAttributeRedeclaredEntity"}.tap do |x|
1374
- expect(x).to be_instance_of(Expressir::Model::Entity)
1375
- expect(x.explicit).to be_instance_of(Array)
1376
- expect(x.explicit.count).to eq(1)
1377
- expect(x.explicit[0]).to be_instance_of(Expressir::Model::Explicit)
1378
- expect(x.explicit[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1379
- expect(x.explicit[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Ref)
1380
- expect(x.explicit[0].supertype_attribute.ref.id).to eq("SELF")
1381
- expect(x.explicit[0].supertype_attribute.qualifiers).to be_instance_of(Array)
1382
- expect(x.explicit[0].supertype_attribute.qualifiers.count).to eq(2)
1383
- expect(x.explicit[0].supertype_attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1384
- expect(x.explicit[0].supertype_attribute.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1385
- expect(x.explicit[0].supertype_attribute.qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1386
- expect(x.explicit[0].supertype_attribute.qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1387
- expect(x.explicit[0].supertype_attribute.qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1388
- expect(x.explicit[0].supertype_attribute.qualifiers[1].attribute.id).to eq("test")
1389
- expect(x.explicit[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1390
- end
1391
-
1392
- entities.find{|x| x.id == "explicitAttributeRedeclaredRenamedEntity"}.tap do |x|
1393
- expect(x).to be_instance_of(Expressir::Model::Entity)
1394
- expect(x.explicit).to be_instance_of(Array)
1395
- expect(x.explicit.count).to eq(1)
1396
- expect(x.explicit[0]).to be_instance_of(Expressir::Model::Explicit)
1397
- expect(x.explicit[0].id).to eq("test2")
1398
- expect(x.explicit[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1399
- expect(x.explicit[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Ref)
1400
- expect(x.explicit[0].supertype_attribute.ref.id).to eq("SELF")
1401
- expect(x.explicit[0].supertype_attribute.qualifiers).to be_instance_of(Array)
1402
- expect(x.explicit[0].supertype_attribute.qualifiers.count).to eq(2)
1403
- expect(x.explicit[0].supertype_attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1404
- expect(x.explicit[0].supertype_attribute.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1405
- expect(x.explicit[0].supertype_attribute.qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1406
- expect(x.explicit[0].supertype_attribute.qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1407
- expect(x.explicit[0].supertype_attribute.qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1408
- expect(x.explicit[0].supertype_attribute.qualifiers[1].attribute.id).to eq("test")
1409
- expect(x.explicit[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1410
- end
1411
-
1412
- entities.find{|x| x.id == "derivedAttributeEntity"}.tap do |x|
1413
- expect(x).to be_instance_of(Expressir::Model::Entity)
1414
- expect(x.derived).to be_instance_of(Array)
1415
- expect(x.derived.count).to eq(1)
1416
- expect(x.derived[0]).to be_instance_of(Expressir::Model::Derived)
1417
- expect(x.derived[0].id).to eq("test")
1418
- expect(x.derived[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1419
- expect(x.derived[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1420
- expect(x.derived[0].expression.value).to eq(true)
1421
- end
1422
-
1423
- entities.find{|x| x.id == "derivedAttributeRedeclaredEntity"}.tap do |x|
1424
- expect(x).to be_instance_of(Expressir::Model::Entity)
1425
- expect(x.derived).to be_instance_of(Array)
1426
- expect(x.derived.count).to eq(1)
1427
- expect(x.derived[0]).to be_instance_of(Expressir::Model::Derived)
1428
- expect(x.derived[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1429
- expect(x.derived[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Ref)
1430
- expect(x.derived[0].supertype_attribute.ref.id).to eq("SELF")
1431
- expect(x.derived[0].supertype_attribute.qualifiers).to be_instance_of(Array)
1432
- expect(x.derived[0].supertype_attribute.qualifiers.count).to eq(2)
1433
- expect(x.derived[0].supertype_attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1434
- expect(x.derived[0].supertype_attribute.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1435
- expect(x.derived[0].supertype_attribute.qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1436
- expect(x.derived[0].supertype_attribute.qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1437
- expect(x.derived[0].supertype_attribute.qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1438
- expect(x.derived[0].supertype_attribute.qualifiers[1].attribute.id).to eq("test")
1439
- expect(x.derived[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1440
- expect(x.derived[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1441
- expect(x.derived[0].expression.value).to eq(true)
1442
- end
1443
-
1444
- entities.find{|x| x.id == "derivedAttributeRedeclaredRenamedEntity"}.tap do |x|
1445
- expect(x).to be_instance_of(Expressir::Model::Entity)
1446
- expect(x.derived).to be_instance_of(Array)
1447
- expect(x.derived.count).to eq(1)
1448
- expect(x.derived[0]).to be_instance_of(Expressir::Model::Derived)
1449
- expect(x.derived[0].id).to eq("test2")
1450
- expect(x.derived[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1451
- expect(x.derived[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Ref)
1452
- expect(x.derived[0].supertype_attribute.ref.id).to eq("SELF")
1453
- expect(x.derived[0].supertype_attribute.qualifiers).to be_instance_of(Array)
1454
- expect(x.derived[0].supertype_attribute.qualifiers.count).to eq(2)
1455
- expect(x.derived[0].supertype_attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1456
- expect(x.derived[0].supertype_attribute.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1457
- expect(x.derived[0].supertype_attribute.qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1458
- expect(x.derived[0].supertype_attribute.qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1459
- expect(x.derived[0].supertype_attribute.qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1460
- expect(x.derived[0].supertype_attribute.qualifiers[1].attribute.id).to eq("test")
1461
- expect(x.derived[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1462
- expect(x.derived[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1463
- expect(x.derived[0].expression.value).to eq(true)
1464
- end
1465
-
1466
- entities.find{|x| x.id == "inverseAttributeEntity"}.tap do |x|
1467
- expect(x).to be_instance_of(Expressir::Model::Entity)
1468
- expect(x.inverse).to be_instance_of(Array)
1469
- expect(x.inverse.count).to eq(1)
1470
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1471
- expect(x.inverse[0].id).to eq("test")
1472
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Ref)
1473
- expect(x.inverse[0].type.id).to eq("explicitAttributeEntity")
1474
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1475
- expect(x.inverse[0].attribute.id).to eq("test")
1476
- end
1477
-
1478
- entities.find{|x| x.id == "inverseAttributeEntityEntity"}.tap do |x|
1479
- expect(x).to be_instance_of(Expressir::Model::Entity)
1480
- expect(x.inverse).to be_instance_of(Array)
1481
- expect(x.inverse.count).to eq(1)
1482
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1483
- expect(x.inverse[0].id).to eq("test")
1484
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Ref)
1485
- expect(x.inverse[0].type.id).to eq("explicitAttributeEntity")
1486
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1487
- expect(x.inverse[0].attribute.ref).to be_instance_of(Expressir::Model::Ref)
1488
- expect(x.inverse[0].attribute.ref.id).to eq("explicitAttributeEntity")
1489
- expect(x.inverse[0].attribute.qualifiers).to be_instance_of(Array)
1490
- expect(x.inverse[0].attribute.qualifiers.count).to eq(1)
1491
- expect(x.inverse[0].attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1492
- expect(x.inverse[0].attribute.qualifiers[0].attribute).to be_instance_of(Expressir::Model::Ref)
1493
- expect(x.inverse[0].attribute.qualifiers[0].attribute.id).to eq("test")
1494
- end
1495
-
1496
- entities.find{|x| x.id == "inverseAttributeSetEntity"}.tap do |x|
1497
- expect(x).to be_instance_of(Expressir::Model::Entity)
1498
- expect(x.inverse).to be_instance_of(Array)
1499
- expect(x.inverse.count).to eq(1)
1500
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1501
- expect(x.inverse[0].id).to eq("test")
1502
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Types::Set)
1503
- expect(x.inverse[0].type.base_type).to be_instance_of(Expressir::Model::Ref)
1504
- expect(x.inverse[0].type.base_type.id).to eq("explicitAttributeEntity")
1505
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1506
- expect(x.inverse[0].attribute.id).to eq("test")
1507
- end
1508
-
1509
- entities.find{|x| x.id == "inverseAttributeSetBoundEntity"}.tap do |x|
1510
- expect(x).to be_instance_of(Expressir::Model::Entity)
1511
- expect(x.inverse).to be_instance_of(Array)
1512
- expect(x.inverse.count).to eq(1)
1513
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1514
- expect(x.inverse[0].id).to eq("test")
1515
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Types::Set)
1516
- expect(x.inverse[0].type.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1517
- expect(x.inverse[0].type.bound1.value).to eq("1")
1518
- expect(x.inverse[0].type.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1519
- expect(x.inverse[0].type.bound2.value).to eq("9")
1520
- expect(x.inverse[0].type.base_type).to be_instance_of(Expressir::Model::Ref)
1521
- expect(x.inverse[0].type.base_type.id).to eq("explicitAttributeEntity")
1522
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1523
- expect(x.inverse[0].attribute.id).to eq("test")
1524
- end
1525
-
1526
- entities.find{|x| x.id == "inverseAttributeBagEntity"}.tap do |x|
1527
- expect(x).to be_instance_of(Expressir::Model::Entity)
1528
- expect(x.inverse).to be_instance_of(Array)
1529
- expect(x.inverse.count).to eq(1)
1530
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1531
- expect(x.inverse[0].id).to eq("test")
1532
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Types::Bag)
1533
- expect(x.inverse[0].type.base_type).to be_instance_of(Expressir::Model::Ref)
1534
- expect(x.inverse[0].type.base_type.id).to eq("explicitAttributeEntity")
1535
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1536
- expect(x.inverse[0].attribute.id).to eq("test")
1537
- end
1538
-
1539
- entities.find{|x| x.id == "inverseAttributeBagBoundEntity"}.tap do |x|
1540
- expect(x).to be_instance_of(Expressir::Model::Entity)
1541
- expect(x.inverse).to be_instance_of(Array)
1542
- expect(x.inverse.count).to eq(1)
1543
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1544
- expect(x.inverse[0].id).to eq("test")
1545
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Types::Bag)
1546
- expect(x.inverse[0].type.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
1547
- expect(x.inverse[0].type.bound1.value).to eq("1")
1548
- expect(x.inverse[0].type.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
1549
- expect(x.inverse[0].type.bound2.value).to eq("9")
1550
- expect(x.inverse[0].type.base_type).to be_instance_of(Expressir::Model::Ref)
1551
- expect(x.inverse[0].type.base_type.id).to eq("explicitAttributeEntity")
1552
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1553
- expect(x.inverse[0].attribute.id).to eq("test")
1554
- end
1555
-
1556
- entities.find{|x| x.id == "inverseAttributeRedeclaredEntity"}.tap do |x|
1557
- expect(x).to be_instance_of(Expressir::Model::Entity)
1558
- expect(x.inverse).to be_instance_of(Array)
1559
- expect(x.inverse.count).to eq(1)
1560
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1561
- expect(x.inverse[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1562
- expect(x.inverse[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Ref)
1563
- expect(x.inverse[0].supertype_attribute.ref.id).to eq("SELF")
1564
- expect(x.inverse[0].supertype_attribute.qualifiers).to be_instance_of(Array)
1565
- expect(x.inverse[0].supertype_attribute.qualifiers.count).to eq(2)
1566
- expect(x.inverse[0].supertype_attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1567
- expect(x.inverse[0].supertype_attribute.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1568
- expect(x.inverse[0].supertype_attribute.qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1569
- expect(x.inverse[0].supertype_attribute.qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1570
- expect(x.inverse[0].supertype_attribute.qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1571
- expect(x.inverse[0].supertype_attribute.qualifiers[1].attribute.id).to eq("test")
1572
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Ref)
1573
- expect(x.inverse[0].type.id).to eq("explicitAttributeEntity")
1574
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1575
- expect(x.inverse[0].attribute.id).to eq("test")
1576
- end
1577
-
1578
- entities.find{|x| x.id == "inverseAttributeRedeclaredRenamedEntity"}.tap do |x|
1579
- expect(x).to be_instance_of(Expressir::Model::Entity)
1580
- expect(x.inverse).to be_instance_of(Array)
1581
- expect(x.inverse.count).to eq(1)
1582
- expect(x.inverse[0]).to be_instance_of(Expressir::Model::Inverse)
1583
- expect(x.inverse[0].id).to eq("test2")
1584
- expect(x.inverse[0].supertype_attribute).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1585
- expect(x.inverse[0].supertype_attribute.ref).to be_instance_of(Expressir::Model::Ref)
1586
- expect(x.inverse[0].supertype_attribute.ref.id).to eq("SELF")
1587
- expect(x.inverse[0].supertype_attribute.qualifiers).to be_instance_of(Array)
1588
- expect(x.inverse[0].supertype_attribute.qualifiers.count).to eq(2)
1589
- expect(x.inverse[0].supertype_attribute.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1590
- expect(x.inverse[0].supertype_attribute.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1591
- expect(x.inverse[0].supertype_attribute.qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1592
- expect(x.inverse[0].supertype_attribute.qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1593
- expect(x.inverse[0].supertype_attribute.qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1594
- expect(x.inverse[0].supertype_attribute.qualifiers[1].attribute.id).to eq("test")
1595
- expect(x.inverse[0].type).to be_instance_of(Expressir::Model::Ref)
1596
- expect(x.inverse[0].type.id).to eq("explicitAttributeEntity")
1597
- expect(x.inverse[0].attribute).to be_instance_of(Expressir::Model::Ref)
1598
- expect(x.inverse[0].attribute.id).to eq("test")
1599
- end
1600
-
1601
- entities.find{|x| x.id == "uniqueEntity"}.tap do |x|
1602
- expect(x).to be_instance_of(Expressir::Model::Entity)
1603
- expect(x.unique).to be_instance_of(Array)
1604
- expect(x.unique.count).to eq(1)
1605
- expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
1606
- expect(x.unique[0].attributes).to be_instance_of(Array)
1607
- expect(x.unique[0].attributes.count).to eq(1)
1608
- expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Ref)
1609
- expect(x.unique[0].attributes[0].id).to eq("test")
1610
- end
1611
-
1612
- entities.find{|x| x.id == "uniqueLabelEntity"}.tap do |x|
1613
- expect(x).to be_instance_of(Expressir::Model::Entity)
1614
- expect(x.unique).to be_instance_of(Array)
1615
- expect(x.unique.count).to eq(1)
1616
- expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
1617
- expect(x.unique[0].id).to eq("UR1")
1618
- expect(x.unique[0].attributes).to be_instance_of(Array)
1619
- expect(x.unique[0].attributes.count).to eq(1)
1620
- expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Ref)
1621
- expect(x.unique[0].attributes[0].id).to eq("test")
1622
- end
1623
-
1624
- entities.find{|x| x.id == "uniqueQualifiedEntity"}.tap do |x|
1625
- expect(x).to be_instance_of(Expressir::Model::Entity)
1626
- expect(x.unique).to be_instance_of(Array)
1627
- expect(x.unique.count).to eq(1)
1628
- expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
1629
- expect(x.unique[0].attributes).to be_instance_of(Array)
1630
- expect(x.unique[0].attributes.count).to eq(1)
1631
- expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1632
- expect(x.unique[0].attributes[0].ref).to be_instance_of(Expressir::Model::Ref)
1633
- expect(x.unique[0].attributes[0].ref.id).to eq("SELF")
1634
- expect(x.unique[0].attributes[0].qualifiers).to be_instance_of(Array)
1635
- expect(x.unique[0].attributes[0].qualifiers.count).to eq(2)
1636
- expect(x.unique[0].attributes[0].qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1637
- expect(x.unique[0].attributes[0].qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1638
- expect(x.unique[0].attributes[0].qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1639
- expect(x.unique[0].attributes[0].qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1640
- expect(x.unique[0].attributes[0].qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1641
- expect(x.unique[0].attributes[0].qualifiers[1].attribute.id).to eq("test")
1642
- end
1643
-
1644
- entities.find{|x| x.id == "uniqueLabelEntity"}.tap do |x|
1645
- expect(x).to be_instance_of(Expressir::Model::Entity)
1646
- expect(x.unique).to be_instance_of(Array)
1647
- expect(x.unique.count).to eq(1)
1648
- expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
1649
- expect(x.unique[0].id).to eq("UR1")
1650
- expect(x.unique[0].attributes).to be_instance_of(Array)
1651
- expect(x.unique[0].attributes.count).to eq(1)
1652
- expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Ref)
1653
- expect(x.unique[0].attributes[0].id).to eq("test")
1654
- end
1655
-
1656
- entities.find{|x| x.id == "uniqueLabelQualifiedEntity"}.tap do |x|
1657
- expect(x).to be_instance_of(Expressir::Model::Entity)
1658
- expect(x.unique).to be_instance_of(Array)
1659
- expect(x.unique.count).to eq(1)
1660
- expect(x.unique[0]).to be_instance_of(Expressir::Model::Unique)
1661
- expect(x.unique[0].id).to eq("UR1")
1662
- expect(x.unique[0].attributes).to be_instance_of(Array)
1663
- expect(x.unique[0].attributes.count).to eq(1)
1664
- expect(x.unique[0].attributes[0]).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
1665
- expect(x.unique[0].attributes[0].ref).to be_instance_of(Expressir::Model::Ref)
1666
- expect(x.unique[0].attributes[0].ref.id).to eq("SELF")
1667
- expect(x.unique[0].attributes[0].qualifiers).to be_instance_of(Array)
1668
- expect(x.unique[0].attributes[0].qualifiers.count).to eq(2)
1669
- expect(x.unique[0].attributes[0].qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
1670
- expect(x.unique[0].attributes[0].qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
1671
- expect(x.unique[0].attributes[0].qualifiers[0].entity.id).to eq("explicitAttributeEntity")
1672
- expect(x.unique[0].attributes[0].qualifiers[1]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
1673
- expect(x.unique[0].attributes[0].qualifiers[1].attribute).to be_instance_of(Expressir::Model::Ref)
1674
- expect(x.unique[0].attributes[0].qualifiers[1].attribute.id).to eq("test")
1675
- end
1676
-
1677
- entities.find{|x| x.id == "whereEntity"}.tap do |x|
1678
- expect(x).to be_instance_of(Expressir::Model::Entity)
1679
- expect(x.where).to be_instance_of(Array)
1680
- expect(x.where.count).to eq(1)
1681
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1682
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1683
- expect(x.where[0].expression.value).to eq(true)
1684
- end
1685
-
1686
- entities.find{|x| x.id == "whereLabelEntity"}.tap do |x|
1687
- expect(x).to be_instance_of(Expressir::Model::Entity)
1688
- expect(x.where).to be_instance_of(Array)
1689
- expect(x.where.count).to eq(1)
1690
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
1691
- expect(x.where[0].id).to eq("WR1")
1692
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
1693
- expect(x.where[0].expression.value).to eq(true)
1694
- end
1695
-
1696
- # subtype constraints
1697
- subtype_constraints.find{|x| x.id == "emptySubtypeConstraint"}.tap do |x|
1698
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1699
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1700
- expect(x.applies_to.id).to eq("emptyEntity")
1701
- end
1702
-
1703
- subtype_constraints.find{|x| x.id == "abstractSupertypeSubtypeConstraint"}.tap do |x|
1704
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1705
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1706
- expect(x.applies_to.id).to eq("emptyEntity")
1707
- expect(x.abstract_supertype).to eq(true)
1708
- end
1709
-
1710
- subtype_constraints.find{|x| x.id == "totalOverSubtypeConstraint"}.tap do |x|
1711
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1712
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1713
- expect(x.applies_to.id).to eq("emptyEntity")
1714
- expect(x.total_over).to be_instance_of(Array)
1715
- expect(x.total_over.count).to eq(1)
1716
- expect(x.total_over[0]).to be_instance_of(Expressir::Model::Ref)
1717
- expect(x.total_over[0].id).to eq("a")
1718
- end
1719
-
1720
- subtype_constraints.find{|x| x.id == "supertypeExpressionSubtypeConstraint"}.tap do |x|
1721
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1722
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1723
- expect(x.applies_to.id).to eq("emptyEntity")
1724
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Ref)
1725
- expect(x.subtype_expression.id).to eq("a")
1726
- end
1727
-
1728
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndorSubtypeConstraint"}.tap do |x|
1729
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1730
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1731
- expect(x.applies_to.id).to eq("emptyEntity")
1732
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1733
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Andor)
1734
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1735
- expect(x.subtype_expression.operands.count).to eq(2)
1736
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1737
- expect(x.subtype_expression.operands[0].id).to eq("a")
1738
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1739
- expect(x.subtype_expression.operands[1].id).to eq("b")
1740
- end
1741
-
1742
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndSubtypeConstraint"}.tap do |x|
1743
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1744
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1745
- expect(x.applies_to.id).to eq("emptyEntity")
1746
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1747
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::And)
1748
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1749
- expect(x.subtype_expression.operands.count).to eq(2)
1750
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1751
- expect(x.subtype_expression.operands[0].id).to eq("a")
1752
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1753
- expect(x.subtype_expression.operands[1].id).to eq("b")
1754
- end
1755
-
1756
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndorAndSubtypeConstraint"}.tap do |x|
1757
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1758
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1759
- expect(x.applies_to.id).to eq("emptyEntity")
1760
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1761
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Andor)
1762
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1763
- expect(x.subtype_expression.operands.count).to eq(2)
1764
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1765
- expect(x.subtype_expression.operands[0].id).to eq("a")
1766
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
1767
- expect(x.subtype_expression.operands[1].operator).to be_instance_of(Expressir::Model::Operators::And)
1768
- expect(x.subtype_expression.operands[1].operands).to be_instance_of(Array)
1769
- expect(x.subtype_expression.operands[1].operands.count).to eq(2)
1770
- expect(x.subtype_expression.operands[1].operands[0]).to be_instance_of(Expressir::Model::Ref)
1771
- expect(x.subtype_expression.operands[1].operands[0].id).to eq("b")
1772
- expect(x.subtype_expression.operands[1].operands[1]).to be_instance_of(Expressir::Model::Ref)
1773
- expect(x.subtype_expression.operands[1].operands[1].id).to eq("c")
1774
- end
1775
-
1776
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndAndorSubtypeConstraint"}.tap do |x|
1777
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1778
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1779
- expect(x.applies_to.id).to eq("emptyEntity")
1780
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1781
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Andor)
1782
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1783
- expect(x.subtype_expression.operands.count).to eq(2)
1784
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
1785
- expect(x.subtype_expression.operands[0].operator).to be_instance_of(Expressir::Model::Operators::And)
1786
- expect(x.subtype_expression.operands[0].operands).to be_instance_of(Array)
1787
- expect(x.subtype_expression.operands[0].operands.count).to eq(2)
1788
- expect(x.subtype_expression.operands[0].operands[0]).to be_instance_of(Expressir::Model::Ref)
1789
- expect(x.subtype_expression.operands[0].operands[0].id).to eq("a")
1790
- expect(x.subtype_expression.operands[0].operands[1]).to be_instance_of(Expressir::Model::Ref)
1791
- expect(x.subtype_expression.operands[0].operands[1].id).to eq("b")
1792
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1793
- expect(x.subtype_expression.operands[1].id).to eq("c")
1794
- end
1795
-
1796
- subtype_constraints.find{|x| x.id == "supertypeExpressionParenthesisAndorAndSubtypeConstraint"}.tap do |x|
1797
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1798
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1799
- expect(x.applies_to.id).to eq("emptyEntity")
1800
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1801
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::And)
1802
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1803
- expect(x.subtype_expression.operands.count).to eq(2)
1804
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
1805
- expect(x.subtype_expression.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Andor)
1806
- expect(x.subtype_expression.operands[0].operands).to be_instance_of(Array)
1807
- expect(x.subtype_expression.operands[0].operands.count).to eq(2)
1808
- expect(x.subtype_expression.operands[0].operands[0]).to be_instance_of(Expressir::Model::Ref)
1809
- expect(x.subtype_expression.operands[0].operands[0].id).to eq("a")
1810
- expect(x.subtype_expression.operands[0].operands[1]).to be_instance_of(Expressir::Model::Ref)
1811
- expect(x.subtype_expression.operands[0].operands[1].id).to eq("b")
1812
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1813
- expect(x.subtype_expression.operands[1].id).to eq("c")
1814
- end
1815
-
1816
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndParenthesisAndorSubtypeConstraint"}.tap do |x|
1817
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1818
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1819
- expect(x.applies_to.id).to eq("emptyEntity")
1820
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1821
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::And)
1822
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1823
- expect(x.subtype_expression.operands.count).to eq(2)
1824
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1825
- expect(x.subtype_expression.operands[0].id).to eq("a")
1826
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
1827
- expect(x.subtype_expression.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Andor)
1828
- expect(x.subtype_expression.operands[1].operands).to be_instance_of(Array)
1829
- expect(x.subtype_expression.operands[1].operands.count).to eq(2)
1830
- expect(x.subtype_expression.operands[1].operands[0]).to be_instance_of(Expressir::Model::Ref)
1831
- expect(x.subtype_expression.operands[1].operands[0].id).to eq("b")
1832
- expect(x.subtype_expression.operands[1].operands[1]).to be_instance_of(Expressir::Model::Ref)
1833
- expect(x.subtype_expression.operands[1].operands[1].id).to eq("c")
1834
- end
1835
-
1836
- subtype_constraints.find{|x| x.id == "supertypeExpressionOneofSubtypeConstraint"}.tap do |x|
1837
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1838
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1839
- expect(x.applies_to.id).to eq("emptyEntity")
1840
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1841
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1842
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1843
- expect(x.subtype_expression.operands.count).to eq(2)
1844
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1845
- expect(x.subtype_expression.operands[0].id).to eq("a")
1846
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1847
- expect(x.subtype_expression.operands[1].id).to eq("b")
1848
- end
1849
-
1850
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndOneofSubtypeConstraint"}.tap do |x|
1851
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1852
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1853
- expect(x.applies_to.id).to eq("emptyEntity")
1854
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1855
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::And)
1856
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1857
- expect(x.subtype_expression.operands.count).to eq(2)
1858
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1859
- expect(x.subtype_expression.operands[0].id).to eq("a")
1860
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
1861
- expect(x.subtype_expression.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1862
- expect(x.subtype_expression.operands[1].operands).to be_instance_of(Array)
1863
- expect(x.subtype_expression.operands[1].operands.count).to eq(2)
1864
- expect(x.subtype_expression.operands[1].operands[0]).to be_instance_of(Expressir::Model::Ref)
1865
- expect(x.subtype_expression.operands[1].operands[0].id).to eq("b")
1866
- expect(x.subtype_expression.operands[1].operands[1]).to be_instance_of(Expressir::Model::Ref)
1867
- expect(x.subtype_expression.operands[1].operands[1].id).to eq("c")
1868
- end
1869
-
1870
- subtype_constraints.find{|x| x.id == "supertypeExpressionAndorOneofSubtypeConstraint"}.tap do |x|
1871
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1872
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1873
- expect(x.applies_to.id).to eq("emptyEntity")
1874
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1875
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Andor)
1876
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1877
- expect(x.subtype_expression.operands.count).to eq(2)
1878
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Ref)
1879
- expect(x.subtype_expression.operands[0].id).to eq("a")
1880
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
1881
- expect(x.subtype_expression.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1882
- expect(x.subtype_expression.operands[1].operands).to be_instance_of(Array)
1883
- expect(x.subtype_expression.operands[1].operands.count).to eq(2)
1884
- expect(x.subtype_expression.operands[1].operands[0]).to be_instance_of(Expressir::Model::Ref)
1885
- expect(x.subtype_expression.operands[1].operands[0].id).to eq("b")
1886
- expect(x.subtype_expression.operands[1].operands[1]).to be_instance_of(Expressir::Model::Ref)
1887
- expect(x.subtype_expression.operands[1].operands[1].id).to eq("c")
1888
- end
1889
-
1890
- subtype_constraints.find{|x| x.id == "supertypeExpressionOneofAndSubtypeConstraint"}.tap do |x|
1891
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1892
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1893
- expect(x.applies_to.id).to eq("emptyEntity")
1894
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1895
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::And)
1896
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1897
- expect(x.subtype_expression.operands.count).to eq(2)
1898
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
1899
- expect(x.subtype_expression.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1900
- expect(x.subtype_expression.operands[0].operands).to be_instance_of(Array)
1901
- expect(x.subtype_expression.operands[0].operands.count).to eq(2)
1902
- expect(x.subtype_expression.operands[0].operands[0]).to be_instance_of(Expressir::Model::Ref)
1903
- expect(x.subtype_expression.operands[0].operands[0].id).to eq("a")
1904
- expect(x.subtype_expression.operands[0].operands[1]).to be_instance_of(Expressir::Model::Ref)
1905
- expect(x.subtype_expression.operands[0].operands[1].id).to eq("b")
1906
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1907
- expect(x.subtype_expression.operands[1].id).to eq("c")
1908
- end
1909
-
1910
- subtype_constraints.find{|x| x.id == "supertypeExpressionOneofAndorSubtypeConstraint"}.tap do |x|
1911
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1912
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1913
- expect(x.applies_to.id).to eq("emptyEntity")
1914
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1915
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Andor)
1916
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1917
- expect(x.subtype_expression.operands.count).to eq(2)
1918
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
1919
- expect(x.subtype_expression.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1920
- expect(x.subtype_expression.operands[0].operands).to be_instance_of(Array)
1921
- expect(x.subtype_expression.operands[0].operands.count).to eq(2)
1922
- expect(x.subtype_expression.operands[0].operands[0]).to be_instance_of(Expressir::Model::Ref)
1923
- expect(x.subtype_expression.operands[0].operands[0].id).to eq("a")
1924
- expect(x.subtype_expression.operands[0].operands[1]).to be_instance_of(Expressir::Model::Ref)
1925
- expect(x.subtype_expression.operands[0].operands[1].id).to eq("b")
1926
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Ref)
1927
- expect(x.subtype_expression.operands[1].id).to eq("c")
1928
- end
1929
-
1930
- subtype_constraints.find{|x| x.id == "supertypeExpressionOneofAndOneofSubtypeConstraint"}.tap do |x|
1931
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1932
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1933
- expect(x.applies_to.id).to eq("emptyEntity")
1934
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1935
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::And)
1936
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1937
- expect(x.subtype_expression.operands.count).to eq(2)
1938
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
1939
- expect(x.subtype_expression.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1940
- expect(x.subtype_expression.operands[0].operands).to be_instance_of(Array)
1941
- expect(x.subtype_expression.operands[0].operands.count).to eq(2)
1942
- expect(x.subtype_expression.operands[0].operands[0]).to be_instance_of(Expressir::Model::Ref)
1943
- expect(x.subtype_expression.operands[0].operands[0].id).to eq("a")
1944
- expect(x.subtype_expression.operands[0].operands[1]).to be_instance_of(Expressir::Model::Ref)
1945
- expect(x.subtype_expression.operands[0].operands[1].id).to eq("b")
1946
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
1947
- expect(x.subtype_expression.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1948
- expect(x.subtype_expression.operands[1].operands).to be_instance_of(Array)
1949
- expect(x.subtype_expression.operands[1].operands.count).to eq(2)
1950
- expect(x.subtype_expression.operands[1].operands[0]).to be_instance_of(Expressir::Model::Ref)
1951
- expect(x.subtype_expression.operands[1].operands[0].id).to eq("c")
1952
- expect(x.subtype_expression.operands[1].operands[1]).to be_instance_of(Expressir::Model::Ref)
1953
- expect(x.subtype_expression.operands[1].operands[1].id).to eq("d")
1954
- end
1955
-
1956
- subtype_constraints.find{|x| x.id == "supertypeExpressionOneofAndorOneofSubtypeConstraint"}.tap do |x|
1957
- expect(x).to be_instance_of(Expressir::Model::SubtypeConstraint)
1958
- expect(x.applies_to).to be_instance_of(Expressir::Model::Ref)
1959
- expect(x.applies_to.id).to eq("emptyEntity")
1960
- expect(x.subtype_expression).to be_instance_of(Expressir::Model::Expressions::Expression)
1961
- expect(x.subtype_expression.operator).to be_instance_of(Expressir::Model::Operators::Andor)
1962
- expect(x.subtype_expression.operands).to be_instance_of(Array)
1963
- expect(x.subtype_expression.operands.count).to eq(2)
1964
- expect(x.subtype_expression.operands[0]).to be_instance_of(Expressir::Model::Expressions::Expression)
1965
- expect(x.subtype_expression.operands[0].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1966
- expect(x.subtype_expression.operands[0].operands).to be_instance_of(Array)
1967
- expect(x.subtype_expression.operands[0].operands.count).to eq(2)
1968
- expect(x.subtype_expression.operands[0].operands[0]).to be_instance_of(Expressir::Model::Ref)
1969
- expect(x.subtype_expression.operands[0].operands[0].id).to eq("a")
1970
- expect(x.subtype_expression.operands[0].operands[1]).to be_instance_of(Expressir::Model::Ref)
1971
- expect(x.subtype_expression.operands[0].operands[1].id).to eq("b")
1972
- expect(x.subtype_expression.operands[1]).to be_instance_of(Expressir::Model::Expressions::Expression)
1973
- expect(x.subtype_expression.operands[1].operator).to be_instance_of(Expressir::Model::Operators::Oneof)
1974
- expect(x.subtype_expression.operands[1].operands).to be_instance_of(Array)
1975
- expect(x.subtype_expression.operands[1].operands.count).to eq(2)
1976
- expect(x.subtype_expression.operands[1].operands[0]).to be_instance_of(Expressir::Model::Ref)
1977
- expect(x.subtype_expression.operands[1].operands[0].id).to eq("c")
1978
- expect(x.subtype_expression.operands[1].operands[1]).to be_instance_of(Expressir::Model::Ref)
1979
- expect(x.subtype_expression.operands[1].operands[1].id).to eq("d")
1980
- end
1981
-
1982
- # functions
1983
- functions.find{|x| x.id == "emptyFunction"}.tap do |x|
1984
- expect(x).to be_instance_of(Expressir::Model::Function)
1985
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
1986
- expect(x.statements).to be_instance_of(Array)
1987
- expect(x.statements.count).to eq(1)
1988
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
1989
- end
1990
-
1991
- functions.find{|x| x.id == "parameterFunction"}.tap do |x|
1992
- expect(x).to be_instance_of(Expressir::Model::Function)
1993
- expect(x.parameters).to be_instance_of(Array)
1994
- expect(x.parameters.count).to eq(1)
1995
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
1996
- expect(x.parameters[0].id).to eq("test")
1997
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
1998
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
1999
- expect(x.statements).to be_instance_of(Array)
2000
- expect(x.statements.count).to eq(1)
2001
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2002
- end
2003
-
2004
- functions.find{|x| x.id == "multipleParameterFunction"}.tap do |x|
2005
- expect(x).to be_instance_of(Expressir::Model::Function)
2006
- expect(x.parameters).to be_instance_of(Array)
2007
- expect(x.parameters.count).to eq(2)
2008
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2009
- expect(x.parameters[0].id).to eq("test")
2010
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2011
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2012
- expect(x.parameters[1].id).to eq("test2")
2013
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2014
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2015
- expect(x.statements).to be_instance_of(Array)
2016
- expect(x.statements.count).to eq(1)
2017
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2018
- end
2019
-
2020
- functions.find{|x| x.id == "multipleShorthandParameterFunction"}.tap do |x|
2021
- expect(x).to be_instance_of(Expressir::Model::Function)
2022
- expect(x.parameters).to be_instance_of(Array)
2023
- expect(x.parameters.count).to eq(2)
2024
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2025
- expect(x.parameters[0].id).to eq("test")
2026
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2027
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2028
- expect(x.parameters[1].id).to eq("test2")
2029
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2030
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2031
- expect(x.statements).to be_instance_of(Array)
2032
- expect(x.statements.count).to eq(1)
2033
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2034
- end
2035
-
2036
- functions.find{|x| x.id == "typeFunction"}.tap do |x|
2037
- expect(x).to be_instance_of(Expressir::Model::Function)
2038
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2039
- expect(x.declarations).to be_instance_of(Array)
2040
- expect(x.declarations.count).to eq(1)
2041
- expect(x.declarations[0]).to be_instance_of(Expressir::Model::Type)
2042
- expect(x.declarations[0].id).to eq("integerType")
2043
- expect(x.declarations[0].type).to be_instance_of(Expressir::Model::Types::Integer)
2044
- expect(x.statements).to be_instance_of(Array)
2045
- expect(x.statements.count).to eq(1)
2046
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2047
- end
2048
-
2049
- functions.find{|x| x.id == "constantFunction"}.tap do |x|
2050
- expect(x).to be_instance_of(Expressir::Model::Function)
2051
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2052
- expect(x.constants).to be_instance_of(Array)
2053
- expect(x.constants.count).to eq(1)
2054
- expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
2055
- expect(x.constants[0].id).to eq("test")
2056
- expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::String)
2057
- expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2058
- expect(x.constants[0].expression.value).to eq("xxx")
2059
- expect(x.statements).to be_instance_of(Array)
2060
- expect(x.statements.count).to eq(1)
2061
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2062
- end
2063
-
2064
- functions.find{|x| x.id == "multipleConstantFunction"}.tap do |x|
2065
- expect(x).to be_instance_of(Expressir::Model::Function)
2066
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2067
- expect(x.constants).to be_instance_of(Array)
2068
- expect(x.constants.count).to eq(2)
2069
- expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
2070
- expect(x.constants[0].id).to eq("test")
2071
- expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::String)
2072
- expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2073
- expect(x.constants[0].expression.value).to eq("xxx")
2074
- expect(x.constants[1]).to be_instance_of(Expressir::Model::Constant)
2075
- expect(x.constants[1].id).to eq("test2")
2076
- expect(x.constants[1].type).to be_instance_of(Expressir::Model::Types::String)
2077
- expect(x.constants[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2078
- expect(x.constants[1].expression.value).to eq("xxx")
2079
- expect(x.statements).to be_instance_of(Array)
2080
- expect(x.statements.count).to eq(1)
2081
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2082
- end
2083
-
2084
- functions.find{|x| x.id == "localFunction"}.tap do |x|
2085
- expect(x).to be_instance_of(Expressir::Model::Function)
2086
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2087
- expect(x.locals).to be_instance_of(Array)
2088
- expect(x.locals.count).to eq(1)
2089
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2090
- expect(x.locals[0].id).to eq("test")
2091
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2092
- expect(x.statements).to be_instance_of(Array)
2093
- expect(x.statements.count).to eq(1)
2094
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2095
- end
2096
-
2097
- functions.find{|x| x.id == "multipleLocalFunction"}.tap do |x|
2098
- expect(x).to be_instance_of(Expressir::Model::Function)
2099
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2100
- expect(x.locals).to be_instance_of(Array)
2101
- expect(x.locals.count).to eq(2)
2102
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2103
- expect(x.locals[0].id).to eq("test")
2104
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2105
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2106
- expect(x.locals[1].id).to eq("test2")
2107
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2108
- expect(x.statements).to be_instance_of(Array)
2109
- expect(x.statements.count).to eq(1)
2110
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2111
- end
2112
-
2113
- functions.find{|x| x.id == "multipleShorthandLocalFunction"}.tap do |x|
2114
- expect(x).to be_instance_of(Expressir::Model::Function)
2115
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2116
- expect(x.locals).to be_instance_of(Array)
2117
- expect(x.locals.count).to eq(2)
2118
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2119
- expect(x.locals[0].id).to eq("test")
2120
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2121
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2122
- expect(x.locals[1].id).to eq("test2")
2123
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2124
- expect(x.statements).to be_instance_of(Array)
2125
- expect(x.statements.count).to eq(1)
2126
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2127
- end
2128
-
2129
- functions.find{|x| x.id == "localExpressionFunction"}.tap do |x|
2130
- expect(x).to be_instance_of(Expressir::Model::Function)
2131
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2132
- expect(x.locals).to be_instance_of(Array)
2133
- expect(x.locals.count).to eq(1)
2134
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2135
- expect(x.locals[0].id).to eq("test")
2136
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2137
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2138
- expect(x.locals[0].expression.value).to eq("xxx")
2139
- expect(x.statements).to be_instance_of(Array)
2140
- expect(x.statements.count).to eq(1)
2141
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2142
- end
2143
-
2144
- functions.find{|x| x.id == "multipleLocalExpressionFunction"}.tap do |x|
2145
- expect(x).to be_instance_of(Expressir::Model::Function)
2146
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2147
- expect(x.locals).to be_instance_of(Array)
2148
- expect(x.locals.count).to eq(2)
2149
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2150
- expect(x.locals[0].id).to eq("test")
2151
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2152
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2153
- expect(x.locals[0].expression.value).to eq("xxx")
2154
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2155
- expect(x.locals[1].id).to eq("test2")
2156
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2157
- expect(x.locals[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2158
- expect(x.locals[1].expression.value).to eq("xxx")
2159
- expect(x.statements).to be_instance_of(Array)
2160
- expect(x.statements.count).to eq(1)
2161
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2162
- end
2163
-
2164
- functions.find{|x| x.id == "multipleShorthandLocalExpressionFunction"}.tap do |x|
2165
- expect(x).to be_instance_of(Expressir::Model::Function)
2166
- expect(x.return_type).to be_instance_of(Expressir::Model::Types::Boolean)
2167
- expect(x.locals).to be_instance_of(Array)
2168
- expect(x.locals.count).to eq(2)
2169
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2170
- expect(x.locals[0].id).to eq("test")
2171
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2172
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2173
- expect(x.locals[0].expression.value).to eq("xxx")
2174
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2175
- expect(x.locals[1].id).to eq("test2")
2176
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2177
- expect(x.locals[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2178
- expect(x.locals[1].expression.value).to eq("xxx")
2179
- expect(x.statements).to be_instance_of(Array)
2180
- expect(x.statements.count).to eq(1)
2181
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2182
- end
2183
-
2184
- # procedures
2185
- procedures.find{|x| x.id == "emptyProcedure"}.tap do |x|
2186
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2187
- end
2188
-
2189
- procedures.find{|x| x.id == "parameterProcedure"}.tap do |x|
2190
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2191
- expect(x.parameters).to be_instance_of(Array)
2192
- expect(x.parameters.count).to eq(1)
2193
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2194
- expect(x.parameters[0].id).to eq("test")
2195
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2196
- expect(x.parameters[0].var).not_to eq(true)
2197
- end
2198
-
2199
- procedures.find{|x| x.id == "multipleParameterProcedure"}.tap do |x|
2200
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2201
- expect(x.parameters).to be_instance_of(Array)
2202
- expect(x.parameters.count).to eq(2)
2203
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2204
- expect(x.parameters[0].id).to eq("test")
2205
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2206
- expect(x.parameters[0].var).not_to eq(true)
2207
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2208
- expect(x.parameters[1].id).to eq("test2")
2209
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2210
- expect(x.parameters[1].var).not_to eq(true)
2211
- end
2212
-
2213
- procedures.find{|x| x.id == "multipleShorthandParameterProcedure"}.tap do |x|
2214
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2215
- expect(x.parameters).to be_instance_of(Array)
2216
- expect(x.parameters.count).to eq(2)
2217
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2218
- expect(x.parameters[0].id).to eq("test")
2219
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2220
- expect(x.parameters[0].var).not_to eq(true)
2221
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2222
- expect(x.parameters[1].id).to eq("test2")
2223
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2224
- expect(x.parameters[1].var).not_to eq(true)
2225
- end
2226
-
2227
- procedures.find{|x| x.id == "variableParameterProcedure"}.tap do |x|
2228
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2229
- expect(x.parameters).to be_instance_of(Array)
2230
- expect(x.parameters.count).to eq(1)
2231
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2232
- expect(x.parameters[0].id).to eq("test")
2233
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2234
- expect(x.parameters[0].var).to eq(true)
2235
- end
2236
-
2237
- procedures.find{|x| x.id == "multipleVariableParameterProcedure"}.tap do |x|
2238
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2239
- expect(x.parameters).to be_instance_of(Array)
2240
- expect(x.parameters.count).to eq(2)
2241
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2242
- expect(x.parameters[0].id).to eq("test")
2243
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2244
- expect(x.parameters[0].var).to eq(true)
2245
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2246
- expect(x.parameters[1].id).to eq("test2")
2247
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2248
- expect(x.parameters[1].var).not_to eq(true)
2249
- end
2250
-
2251
- procedures.find{|x| x.id == "multipleVariableParameter2Procedure"}.tap do |x|
2252
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2253
- expect(x.parameters).to be_instance_of(Array)
2254
- expect(x.parameters.count).to eq(2)
2255
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2256
- expect(x.parameters[0].id).to eq("test")
2257
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2258
- expect(x.parameters[0].var).not_to eq(true)
2259
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2260
- expect(x.parameters[1].id).to eq("test2")
2261
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2262
- expect(x.parameters[1].var).to eq(true)
2263
- end
2264
-
2265
- procedures.find{|x| x.id == "multipleShorthandVariableParameterProcedure"}.tap do |x|
2266
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2267
- expect(x.parameters).to be_instance_of(Array)
2268
- expect(x.parameters.count).to eq(2)
2269
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Parameter)
2270
- expect(x.parameters[0].id).to eq("test")
2271
- expect(x.parameters[0].type).to be_instance_of(Expressir::Model::Types::Boolean)
2272
- expect(x.parameters[0].var).to eq(true)
2273
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Parameter)
2274
- expect(x.parameters[1].id).to eq("test2")
2275
- expect(x.parameters[1].type).to be_instance_of(Expressir::Model::Types::Boolean)
2276
- expect(x.parameters[1].var).to eq(true)
2277
- end
2278
-
2279
- procedures.find{|x| x.id == "typeProcedure"}.tap do |x|
2280
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2281
- expect(x.declarations).to be_instance_of(Array)
2282
- expect(x.declarations.count).to eq(1)
2283
- expect(x.declarations[0]).to be_instance_of(Expressir::Model::Type)
2284
- expect(x.declarations[0].id).to eq("integerType")
2285
- expect(x.declarations[0].type).to be_instance_of(Expressir::Model::Types::Integer)
2286
- end
2287
-
2288
- procedures.find{|x| x.id == "constantProcedure"}.tap do |x|
2289
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2290
- expect(x.constants).to be_instance_of(Array)
2291
- expect(x.constants.count).to eq(1)
2292
- expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
2293
- expect(x.constants[0].id).to eq("test")
2294
- expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::String)
2295
- expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2296
- expect(x.constants[0].expression.value).to eq("xxx")
2297
- end
2298
-
2299
- procedures.find{|x| x.id == "multipleConstantProcedure"}.tap do |x|
2300
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2301
- expect(x.constants).to be_instance_of(Array)
2302
- expect(x.constants.count).to eq(2)
2303
- expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
2304
- expect(x.constants[0].id).to eq("test")
2305
- expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::String)
2306
- expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2307
- expect(x.constants[0].expression.value).to eq("xxx")
2308
- expect(x.constants[1]).to be_instance_of(Expressir::Model::Constant)
2309
- expect(x.constants[1].id).to eq("test2")
2310
- expect(x.constants[1].type).to be_instance_of(Expressir::Model::Types::String)
2311
- expect(x.constants[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2312
- expect(x.constants[1].expression.value).to eq("xxx")
2313
- end
2314
-
2315
- procedures.find{|x| x.id == "localProcedure"}.tap do |x|
2316
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2317
- expect(x.locals).to be_instance_of(Array)
2318
- expect(x.locals.count).to eq(1)
2319
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2320
- expect(x.locals[0].id).to eq("test")
2321
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2322
- end
2323
-
2324
- procedures.find{|x| x.id == "multipleLocalProcedure"}.tap do |x|
2325
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2326
- expect(x.locals).to be_instance_of(Array)
2327
- expect(x.locals.count).to eq(2)
2328
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2329
- expect(x.locals[0].id).to eq("test")
2330
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2331
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2332
- expect(x.locals[1].id).to eq("test2")
2333
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2334
- end
2335
-
2336
- procedures.find{|x| x.id == "multipleShorthandLocalProcedure"}.tap do |x|
2337
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2338
- expect(x.locals).to be_instance_of(Array)
2339
- expect(x.locals.count).to eq(2)
2340
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2341
- expect(x.locals[0].id).to eq("test")
2342
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2343
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2344
- expect(x.locals[1].id).to eq("test2")
2345
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2346
- end
2347
-
2348
- procedures.find{|x| x.id == "localExpressionProcedure"}.tap do |x|
2349
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2350
- expect(x.locals).to be_instance_of(Array)
2351
- expect(x.locals.count).to eq(1)
2352
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2353
- expect(x.locals[0].id).to eq("test")
2354
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2355
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2356
- expect(x.locals[0].expression.value).to eq("xxx")
2357
- end
2358
-
2359
- procedures.find{|x| x.id == "multipleLocalExpressionProcedure"}.tap do |x|
2360
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2361
- expect(x.locals).to be_instance_of(Array)
2362
- expect(x.locals.count).to eq(2)
2363
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2364
- expect(x.locals[0].id).to eq("test")
2365
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2366
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2367
- expect(x.locals[0].expression.value).to eq("xxx")
2368
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2369
- expect(x.locals[1].id).to eq("test2")
2370
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2371
- expect(x.locals[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2372
- expect(x.locals[1].expression.value).to eq("xxx")
2373
- end
2374
-
2375
- procedures.find{|x| x.id == "multipleShorthandLocalExpressionProcedure"}.tap do |x|
2376
- expect(x).to be_instance_of(Expressir::Model::Procedure)
2377
- expect(x.locals).to be_instance_of(Array)
2378
- expect(x.locals.count).to eq(2)
2379
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2380
- expect(x.locals[0].id).to eq("test")
2381
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2382
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2383
- expect(x.locals[0].expression.value).to eq("xxx")
2384
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2385
- expect(x.locals[1].id).to eq("test2")
2386
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2387
- expect(x.locals[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2388
- expect(x.locals[1].expression.value).to eq("xxx")
2389
- end
2390
-
2391
- # rules
2392
- rules.find{|x| x.id == "emptyRule"}.tap do |x|
2393
- expect(x).to be_instance_of(Expressir::Model::Rule)
2394
- expect(x.applies_to).to be_instance_of(Array)
2395
- expect(x.applies_to.count).to eq(1)
2396
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2397
- expect(x.applies_to[0].id).to eq("emptyEntity")
2398
- expect(x.where).to be_instance_of(Array)
2399
- expect(x.where.count).to eq(1)
2400
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2401
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2402
- expect(x.where[0].expression.value).to eq(true)
2403
- end
2404
-
2405
- rules.find{|x| x.id == "typeRule"}.tap do |x|
2406
- expect(x).to be_instance_of(Expressir::Model::Rule)
2407
- expect(x.applies_to).to be_instance_of(Array)
2408
- expect(x.applies_to.count).to eq(1)
2409
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2410
- expect(x.applies_to[0].id).to eq("emptyEntity")
2411
- expect(x.declarations).to be_instance_of(Array)
2412
- expect(x.declarations.count).to eq(1)
2413
- expect(x.declarations[0]).to be_instance_of(Expressir::Model::Type)
2414
- expect(x.declarations[0].id).to eq("integerType")
2415
- expect(x.declarations[0].type).to be_instance_of(Expressir::Model::Types::Integer)
2416
- expect(x.where).to be_instance_of(Array)
2417
- expect(x.where.count).to eq(1)
2418
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2419
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2420
- expect(x.where[0].expression.value).to eq(true)
2421
- end
2422
-
2423
- rules.find{|x| x.id == "constantRule"}.tap do |x|
2424
- expect(x).to be_instance_of(Expressir::Model::Rule)
2425
- expect(x.applies_to).to be_instance_of(Array)
2426
- expect(x.applies_to.count).to eq(1)
2427
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2428
- expect(x.applies_to[0].id).to eq("emptyEntity")
2429
- expect(x.constants).to be_instance_of(Array)
2430
- expect(x.constants.count).to eq(1)
2431
- expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
2432
- expect(x.constants[0].id).to eq("test")
2433
- expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::String)
2434
- expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2435
- expect(x.constants[0].expression.value).to eq("xxx")
2436
- expect(x.where).to be_instance_of(Array)
2437
- expect(x.where.count).to eq(1)
2438
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2439
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2440
- expect(x.where[0].expression.value).to eq(true)
2441
- end
2442
-
2443
- rules.find{|x| x.id == "multipleConstantRule"}.tap do |x|
2444
- expect(x).to be_instance_of(Expressir::Model::Rule)
2445
- expect(x.applies_to).to be_instance_of(Array)
2446
- expect(x.applies_to.count).to eq(1)
2447
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2448
- expect(x.applies_to[0].id).to eq("emptyEntity")
2449
- expect(x.constants).to be_instance_of(Array)
2450
- expect(x.constants.count).to eq(2)
2451
- expect(x.constants[0]).to be_instance_of(Expressir::Model::Constant)
2452
- expect(x.constants[0].id).to eq("test")
2453
- expect(x.constants[0].type).to be_instance_of(Expressir::Model::Types::String)
2454
- expect(x.constants[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2455
- expect(x.constants[0].expression.value).to eq("xxx")
2456
- expect(x.constants[1]).to be_instance_of(Expressir::Model::Constant)
2457
- expect(x.constants[1].id).to eq("test2")
2458
- expect(x.constants[1].type).to be_instance_of(Expressir::Model::Types::String)
2459
- expect(x.constants[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2460
- expect(x.constants[1].expression.value).to eq("xxx")
2461
- expect(x.where).to be_instance_of(Array)
2462
- expect(x.where.count).to eq(1)
2463
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2464
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2465
- expect(x.where[0].expression.value).to eq(true)
2466
- end
2467
-
2468
- rules.find{|x| x.id == "localRule"}.tap do |x|
2469
- expect(x).to be_instance_of(Expressir::Model::Rule)
2470
- expect(x.applies_to).to be_instance_of(Array)
2471
- expect(x.applies_to.count).to eq(1)
2472
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2473
- expect(x.applies_to[0].id).to eq("emptyEntity")
2474
- expect(x.locals).to be_instance_of(Array)
2475
- expect(x.locals.count).to eq(1)
2476
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2477
- expect(x.locals[0].id).to eq("test")
2478
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2479
- expect(x.where).to be_instance_of(Array)
2480
- expect(x.where.count).to eq(1)
2481
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2482
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2483
- expect(x.where[0].expression.value).to eq(true)
2484
- end
2485
-
2486
- rules.find{|x| x.id == "multipleLocalRule"}.tap do |x|
2487
- expect(x).to be_instance_of(Expressir::Model::Rule)
2488
- expect(x.applies_to).to be_instance_of(Array)
2489
- expect(x.applies_to.count).to eq(1)
2490
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2491
- expect(x.applies_to[0].id).to eq("emptyEntity")
2492
- expect(x.locals).to be_instance_of(Array)
2493
- expect(x.locals.count).to eq(2)
2494
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2495
- expect(x.locals[0].id).to eq("test")
2496
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2497
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2498
- expect(x.locals[1].id).to eq("test2")
2499
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2500
- expect(x.where).to be_instance_of(Array)
2501
- expect(x.where.count).to eq(1)
2502
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2503
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2504
- expect(x.where[0].expression.value).to eq(true)
2505
- end
2506
-
2507
- rules.find{|x| x.id == "multipleShorthandLocalRule"}.tap do |x|
2508
- expect(x).to be_instance_of(Expressir::Model::Rule)
2509
- expect(x.applies_to).to be_instance_of(Array)
2510
- expect(x.applies_to.count).to eq(1)
2511
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2512
- expect(x.applies_to[0].id).to eq("emptyEntity")
2513
- expect(x.locals).to be_instance_of(Array)
2514
- expect(x.locals.count).to eq(2)
2515
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2516
- expect(x.locals[0].id).to eq("test")
2517
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2518
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2519
- expect(x.locals[1].id).to eq("test2")
2520
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2521
- expect(x.where).to be_instance_of(Array)
2522
- expect(x.where.count).to eq(1)
2523
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2524
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2525
- expect(x.where[0].expression.value).to eq(true)
2526
- end
2527
-
2528
- rules.find{|x| x.id == "localExpressionRule"}.tap do |x|
2529
- expect(x).to be_instance_of(Expressir::Model::Rule)
2530
- expect(x.applies_to).to be_instance_of(Array)
2531
- expect(x.applies_to.count).to eq(1)
2532
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2533
- expect(x.applies_to[0].id).to eq("emptyEntity")
2534
- expect(x.locals).to be_instance_of(Array)
2535
- expect(x.locals.count).to eq(1)
2536
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2537
- expect(x.locals[0].id).to eq("test")
2538
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2539
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2540
- expect(x.locals[0].expression.value).to eq("xxx")
2541
- expect(x.where).to be_instance_of(Array)
2542
- expect(x.where.count).to eq(1)
2543
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2544
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2545
- expect(x.where[0].expression.value).to eq(true)
2546
- end
2547
-
2548
- rules.find{|x| x.id == "multipleLocalExpressionRule"}.tap do |x|
2549
- expect(x).to be_instance_of(Expressir::Model::Rule)
2550
- expect(x.applies_to).to be_instance_of(Array)
2551
- expect(x.applies_to.count).to eq(1)
2552
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2553
- expect(x.applies_to[0].id).to eq("emptyEntity")
2554
- expect(x.locals).to be_instance_of(Array)
2555
- expect(x.locals.count).to eq(2)
2556
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2557
- expect(x.locals[0].id).to eq("test")
2558
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2559
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2560
- expect(x.locals[0].expression.value).to eq("xxx")
2561
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2562
- expect(x.locals[1].id).to eq("test2")
2563
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2564
- expect(x.locals[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2565
- expect(x.locals[1].expression.value).to eq("xxx")
2566
- expect(x.where).to be_instance_of(Array)
2567
- expect(x.where.count).to eq(1)
2568
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2569
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2570
- expect(x.where[0].expression.value).to eq(true)
2571
- end
2572
-
2573
- rules.find{|x| x.id == "multipleShorthandLocalExpressionRule"}.tap do |x|
2574
- expect(x).to be_instance_of(Expressir::Model::Rule)
2575
- expect(x.applies_to).to be_instance_of(Array)
2576
- expect(x.applies_to.count).to eq(1)
2577
- expect(x.applies_to[0]).to be_instance_of(Expressir::Model::Ref)
2578
- expect(x.applies_to[0].id).to eq("emptyEntity")
2579
- expect(x.locals).to be_instance_of(Array)
2580
- expect(x.locals.count).to eq(2)
2581
- expect(x.locals[0]).to be_instance_of(Expressir::Model::Local)
2582
- expect(x.locals[0].id).to eq("test")
2583
- expect(x.locals[0].type).to be_instance_of(Expressir::Model::Types::String)
2584
- expect(x.locals[0].expression).to be_instance_of(Expressir::Model::Literals::String)
2585
- expect(x.locals[0].expression.value).to eq("xxx")
2586
- expect(x.locals[1]).to be_instance_of(Expressir::Model::Local)
2587
- expect(x.locals[1].id).to eq("test2")
2588
- expect(x.locals[1].type).to be_instance_of(Expressir::Model::Types::String)
2589
- expect(x.locals[1].expression).to be_instance_of(Expressir::Model::Literals::String)
2590
- expect(x.locals[1].expression.value).to eq("xxx")
2591
- expect(x.where).to be_instance_of(Array)
2592
- expect(x.where.count).to eq(1)
2593
- expect(x.where[0]).to be_instance_of(Expressir::Model::Where)
2594
- expect(x.where[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2595
- expect(x.where[0].expression.value).to eq(true)
2596
- end
2597
-
2598
- # statements
2599
- functions.find{|x| x.id == "aliasStatement"}.statements[0].tap do |x|
2600
- expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
2601
- expect(x.id).to eq("test")
2602
- expect(x.expression).to be_instance_of(Expressir::Model::Ref)
2603
- expect(x.expression.id).to eq("test")
2604
- expect(x.statements).to be_instance_of(Array)
2605
- expect(x.statements.count).to eq(1)
2606
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2607
- end
2608
-
2609
- functions.find{|x| x.id == "aliasAttributeStatement"}.statements[0].tap do |x|
2610
- expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
2611
- expect(x.id).to eq("test")
2612
- expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2613
- expect(x.expression.ref).to be_instance_of(Expressir::Model::Ref)
2614
- expect(x.expression.ref.id).to eq("test")
2615
- expect(x.expression.qualifiers).to be_instance_of(Array)
2616
- expect(x.expression.qualifiers.count).to eq(1)
2617
- expect(x.expression.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
2618
- expect(x.expression.qualifiers[0].attribute).to be_instance_of(Expressir::Model::Ref)
2619
- expect(x.expression.qualifiers[0].attribute.id).to eq("test")
2620
- expect(x.statements).to be_instance_of(Array)
2621
- expect(x.statements.count).to eq(1)
2622
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2623
- end
2624
-
2625
- functions.find{|x| x.id == "aliasGroupStatement"}.statements[0].tap do |x|
2626
- expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
2627
- expect(x.id).to eq("test")
2628
- expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2629
- expect(x.expression.ref).to be_instance_of(Expressir::Model::Ref)
2630
- expect(x.expression.ref.id).to eq("test")
2631
- expect(x.expression.qualifiers).to be_instance_of(Array)
2632
- expect(x.expression.qualifiers.count).to eq(1)
2633
- expect(x.expression.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
2634
- expect(x.expression.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
2635
- expect(x.expression.qualifiers[0].entity.id).to eq("test")
2636
- expect(x.statements).to be_instance_of(Array)
2637
- expect(x.statements.count).to eq(1)
2638
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2639
- end
2640
-
2641
- functions.find{|x| x.id == "aliasIndexStatement"}.statements[0].tap do |x|
2642
- expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
2643
- expect(x.id).to eq("test")
2644
- expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2645
- expect(x.expression.ref).to be_instance_of(Expressir::Model::Ref)
2646
- expect(x.expression.ref.id).to eq("test")
2647
- expect(x.expression.qualifiers).to be_instance_of(Array)
2648
- expect(x.expression.qualifiers.count).to eq(1)
2649
- expect(x.expression.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::IndexQualifier)
2650
- expect(x.expression.qualifiers[0].index1).to be_instance_of(Expressir::Model::Literals::Integer)
2651
- expect(x.expression.qualifiers[0].index1.value).to eq("1")
2652
- expect(x.statements).to be_instance_of(Array)
2653
- expect(x.statements.count).to eq(1)
2654
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2655
- end
2656
-
2657
- functions.find{|x| x.id == "aliasIndex2Statement"}.statements[0].tap do |x|
2658
- expect(x).to be_instance_of(Expressir::Model::Statements::Alias)
2659
- expect(x.id).to eq("test")
2660
- expect(x.expression).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2661
- expect(x.expression.ref).to be_instance_of(Expressir::Model::Ref)
2662
- expect(x.expression.ref.id).to eq("test")
2663
- expect(x.expression.qualifiers).to be_instance_of(Array)
2664
- expect(x.expression.qualifiers.count).to eq(1)
2665
- expect(x.expression.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::IndexQualifier)
2666
- expect(x.expression.qualifiers[0].index1).to be_instance_of(Expressir::Model::Literals::Integer)
2667
- expect(x.expression.qualifiers[0].index1.value).to eq("1")
2668
- expect(x.expression.qualifiers[0].index2).to be_instance_of(Expressir::Model::Literals::Integer)
2669
- expect(x.expression.qualifiers[0].index2.value).to eq("9")
2670
- expect(x.statements).to be_instance_of(Array)
2671
- expect(x.statements.count).to eq(1)
2672
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2673
- end
2674
-
2675
- functions.find{|x| x.id == "assignmentStatement"}.statements[0].tap do |x|
2676
- expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
2677
- expect(x.ref).to be_instance_of(Expressir::Model::Ref)
2678
- expect(x.ref.id).to eq("test")
2679
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2680
- expect(x.expression.value).to eq(true)
2681
- end
2682
-
2683
- functions.find{|x| x.id == "assignmentAttributeStatement"}.statements[0].tap do |x|
2684
- expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
2685
- expect(x.ref).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2686
- expect(x.ref.ref).to be_instance_of(Expressir::Model::Ref)
2687
- expect(x.ref.ref.id).to eq("test")
2688
- expect(x.ref.qualifiers).to be_instance_of(Array)
2689
- expect(x.ref.qualifiers.count).to eq(1)
2690
- expect(x.ref.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::AttributeQualifier)
2691
- expect(x.ref.qualifiers[0].attribute).to be_instance_of(Expressir::Model::Ref)
2692
- expect(x.ref.qualifiers[0].attribute.id).to eq("test")
2693
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2694
- expect(x.expression.value).to eq(true)
2695
- end
2696
-
2697
- functions.find{|x| x.id == "assignmentGroupStatement"}.statements[0].tap do |x|
2698
- expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
2699
- expect(x.ref).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2700
- expect(x.ref.ref).to be_instance_of(Expressir::Model::Ref)
2701
- expect(x.ref.ref.id).to eq("test")
2702
- expect(x.ref.qualifiers).to be_instance_of(Array)
2703
- expect(x.ref.qualifiers.count).to eq(1)
2704
- expect(x.ref.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::GroupQualifier)
2705
- expect(x.ref.qualifiers[0].entity).to be_instance_of(Expressir::Model::Ref)
2706
- expect(x.ref.qualifiers[0].entity.id).to eq("test")
2707
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2708
- expect(x.expression.value).to eq(true)
2709
- end
2710
-
2711
- functions.find{|x| x.id == "assignmentIndexStatement"}.statements[0].tap do |x|
2712
- expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
2713
- expect(x.ref).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2714
- expect(x.ref.ref).to be_instance_of(Expressir::Model::Ref)
2715
- expect(x.ref.ref.id).to eq("test")
2716
- expect(x.ref.qualifiers).to be_instance_of(Array)
2717
- expect(x.ref.qualifiers.count).to eq(1)
2718
- expect(x.ref.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::IndexQualifier)
2719
- expect(x.ref.qualifiers[0].index1).to be_instance_of(Expressir::Model::Literals::Integer)
2720
- expect(x.ref.qualifiers[0].index1.value).to eq("1")
2721
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2722
- expect(x.expression.value).to eq(true)
2723
- end
2724
-
2725
- functions.find{|x| x.id == "assignmentIndex2Statement"}.statements[0].tap do |x|
2726
- expect(x).to be_instance_of(Expressir::Model::Statements::Assignment)
2727
- expect(x.ref).to be_instance_of(Expressir::Model::Expressions::QualifiedRef)
2728
- expect(x.ref.ref).to be_instance_of(Expressir::Model::Ref)
2729
- expect(x.ref.ref.id).to eq("test")
2730
- expect(x.ref.qualifiers).to be_instance_of(Array)
2731
- expect(x.ref.qualifiers.count).to eq(1)
2732
- expect(x.ref.qualifiers[0]).to be_instance_of(Expressir::Model::Expressions::IndexQualifier)
2733
- expect(x.ref.qualifiers[0].index1).to be_instance_of(Expressir::Model::Literals::Integer)
2734
- expect(x.ref.qualifiers[0].index1.value).to eq("1")
2735
- expect(x.ref.qualifiers[0].index2).to be_instance_of(Expressir::Model::Literals::Integer)
2736
- expect(x.ref.qualifiers[0].index2.value).to eq("9")
2737
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2738
- expect(x.expression.value).to eq(true)
2739
- end
2740
-
2741
- functions.find{|x| x.id == "caseStatement"}.statements[0].tap do |x|
2742
- expect(x).to be_instance_of(Expressir::Model::Statements::Case)
2743
- expect(x.selector).to be_instance_of(Expressir::Model::Ref)
2744
- expect(x.selector.id).to eq("test")
2745
- expect(x.actions).to be_instance_of(Array)
2746
- expect(x.actions.count).to eq(1)
2747
- expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
2748
- expect(x.actions[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2749
- expect(x.actions[0].expression.value).to eq(true)
2750
- expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
2751
- end
2752
-
2753
- functions.find{|x| x.id == "caseMultipleStatement"}.statements[0].tap do |x|
2754
- expect(x).to be_instance_of(Expressir::Model::Statements::Case)
2755
- expect(x.selector).to be_instance_of(Expressir::Model::Ref)
2756
- expect(x.selector.id).to eq("test")
2757
- expect(x.actions).to be_instance_of(Array)
2758
- expect(x.actions.count).to eq(2)
2759
- expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
2760
- expect(x.actions[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2761
- expect(x.actions[0].expression.value).to eq(true)
2762
- expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
2763
- expect(x.actions[1]).to be_instance_of(Expressir::Model::Statements::CaseAction)
2764
- expect(x.actions[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2765
- expect(x.actions[1].expression.value).to eq(true)
2766
- expect(x.actions[1].statement).to be_instance_of(Expressir::Model::Statements::Null)
2767
- end
2768
-
2769
- functions.find{|x| x.id == "caseMultipleShorthandStatement"}.statements[0].tap do |x|
2770
- expect(x).to be_instance_of(Expressir::Model::Statements::Case)
2771
- expect(x.selector).to be_instance_of(Expressir::Model::Ref)
2772
- expect(x.selector.id).to eq("test")
2773
- expect(x.actions).to be_instance_of(Array)
2774
- expect(x.actions.count).to eq(2)
2775
- expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
2776
- expect(x.actions[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2777
- expect(x.actions[0].expression.value).to eq(true)
2778
- expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
2779
- expect(x.actions[1]).to be_instance_of(Expressir::Model::Statements::CaseAction)
2780
- expect(x.actions[1].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2781
- expect(x.actions[1].expression.value).to eq(true)
2782
- expect(x.actions[1].statement).to be_instance_of(Expressir::Model::Statements::Null)
2783
- end
2784
-
2785
- functions.find{|x| x.id == "caseOtherwiseStatement"}.statements[0].tap do |x|
2786
- expect(x).to be_instance_of(Expressir::Model::Statements::Case)
2787
- expect(x.selector).to be_instance_of(Expressir::Model::Ref)
2788
- expect(x.selector.id).to eq("test")
2789
- expect(x.actions).to be_instance_of(Array)
2790
- expect(x.actions.count).to eq(1)
2791
- expect(x.actions[0]).to be_instance_of(Expressir::Model::Statements::CaseAction)
2792
- expect(x.actions[0].expression).to be_instance_of(Expressir::Model::Literals::Logical)
2793
- expect(x.actions[0].expression.value).to eq(true)
2794
- expect(x.actions[0].statement).to be_instance_of(Expressir::Model::Statements::Null)
2795
- expect(x.otherwise_statement).to be_instance_of(Expressir::Model::Statements::Null)
2796
- end
2797
-
2798
- functions.find{|x| x.id == "compoundStatement"}.statements[0].tap do |x|
2799
- expect(x).to be_instance_of(Expressir::Model::Statements::Compound)
2800
- expect(x.statements).to be_instance_of(Array)
2801
- expect(x.statements.count).to eq(1)
2802
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2803
- end
2804
-
2805
- functions.find{|x| x.id == "escapeStatement"}.statements[0].tap do |x|
2806
- expect(x).to be_instance_of(Expressir::Model::Statements::Escape)
2807
- end
2808
-
2809
- functions.find{|x| x.id == "ifStatement"}.statements[0].tap do |x|
2810
- expect(x).to be_instance_of(Expressir::Model::Statements::If)
2811
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2812
- expect(x.expression.value).to eq(true)
2813
- expect(x.statements).to be_instance_of(Array)
2814
- expect(x.statements.count).to eq(1)
2815
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2816
- end
2817
-
2818
- functions.find{|x| x.id == "if2Statement"}.statements[0].tap do |x|
2819
- expect(x).to be_instance_of(Expressir::Model::Statements::If)
2820
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2821
- expect(x.expression.value).to eq(true)
2822
- expect(x.statements).to be_instance_of(Array)
2823
- expect(x.statements.count).to eq(2)
2824
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2825
- expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
2826
- end
2827
-
2828
- functions.find{|x| x.id == "ifElseStatement"}.statements[0].tap do |x|
2829
- expect(x).to be_instance_of(Expressir::Model::Statements::If)
2830
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2831
- expect(x.expression.value).to eq(true)
2832
- expect(x.statements).to be_instance_of(Array)
2833
- expect(x.statements.count).to eq(1)
2834
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2835
- expect(x.else_statements).to be_instance_of(Array)
2836
- expect(x.else_statements.count).to eq(1)
2837
- expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2838
- end
2839
-
2840
- functions.find{|x| x.id == "if2ElseStatement"}.statements[0].tap do |x|
2841
- expect(x).to be_instance_of(Expressir::Model::Statements::If)
2842
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2843
- expect(x.expression.value).to eq(true)
2844
- expect(x.statements).to be_instance_of(Array)
2845
- expect(x.statements.count).to eq(2)
2846
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2847
- expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
2848
- expect(x.else_statements).to be_instance_of(Array)
2849
- expect(x.else_statements.count).to eq(1)
2850
- expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2851
- end
2852
-
2853
- functions.find{|x| x.id == "ifElse2Statement"}.statements[0].tap do |x|
2854
- expect(x).to be_instance_of(Expressir::Model::Statements::If)
2855
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2856
- expect(x.expression.value).to eq(true)
2857
- expect(x.statements).to be_instance_of(Array)
2858
- expect(x.statements.count).to eq(1)
2859
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2860
- expect(x.else_statements).to be_instance_of(Array)
2861
- expect(x.else_statements.count).to eq(2)
2862
- expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2863
- expect(x.else_statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
2864
- end
2865
-
2866
- functions.find{|x| x.id == "if2Else2Statement"}.statements[0].tap do |x|
2867
- expect(x).to be_instance_of(Expressir::Model::Statements::If)
2868
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2869
- expect(x.expression.value).to eq(true)
2870
- expect(x.statements).to be_instance_of(Array)
2871
- expect(x.statements.count).to eq(2)
2872
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2873
- expect(x.statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
2874
- expect(x.else_statements).to be_instance_of(Array)
2875
- expect(x.else_statements.count).to eq(2)
2876
- expect(x.else_statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2877
- expect(x.else_statements[1]).to be_instance_of(Expressir::Model::Statements::Null)
2878
- end
2879
-
2880
- functions.find{|x| x.id == "nullStatement"}.statements[0].tap do |x|
2881
- expect(x).to be_instance_of(Expressir::Model::Statements::Null)
2882
- end
2883
-
2884
- functions.find{|x| x.id == "procedureCallStatement"}.statements[0].tap do |x|
2885
- expect(x).to be_instance_of(Expressir::Model::Statements::ProcedureCall)
2886
- expect(x.procedure).to be_instance_of(Expressir::Model::Ref)
2887
- expect(x.procedure.id).to eq("emptyProcedure")
2888
- end
2889
-
2890
- functions.find{|x| x.id == "procedureCallParameterStatement"}.statements[0].tap do |x|
2891
- expect(x).to be_instance_of(Expressir::Model::Statements::ProcedureCall)
2892
- expect(x.procedure).to be_instance_of(Expressir::Model::Ref)
2893
- expect(x.procedure.id).to eq("emptyProcedure")
2894
- expect(x.parameters).to be_instance_of(Array)
2895
- expect(x.parameters.count).to eq(1)
2896
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2897
- expect(x.parameters[0].value).to eq(true)
2898
- end
2899
-
2900
- functions.find{|x| x.id == "procedureCallParameter2Statement"}.statements[0].tap do |x|
2901
- expect(x).to be_instance_of(Expressir::Model::Statements::ProcedureCall)
2902
- expect(x.procedure).to be_instance_of(Expressir::Model::Ref)
2903
- expect(x.procedure.id).to eq("emptyProcedure")
2904
- expect(x.parameters).to be_instance_of(Array)
2905
- expect(x.parameters.count).to eq(2)
2906
- expect(x.parameters[0]).to be_instance_of(Expressir::Model::Literals::Logical)
2907
- expect(x.parameters[0].value).to eq(true)
2908
- expect(x.parameters[1]).to be_instance_of(Expressir::Model::Literals::Logical)
2909
- expect(x.parameters[1].value).to eq(true)
2910
- end
2911
-
2912
- functions.find{|x| x.id == "procedureCallInsertStatement"}.statements[0].tap do |x|
2913
- expect(x).to be_instance_of(Expressir::Model::Statements::ProcedureCall)
2914
- expect(x.procedure).to be_instance_of(Expressir::Model::Ref)
2915
- expect(x.procedure.id).to eq("INSERT")
2916
- end
2917
-
2918
- functions.find{|x| x.id == "procedureCallRemoveStatement"}.statements[0].tap do |x|
2919
- expect(x).to be_instance_of(Expressir::Model::Statements::ProcedureCall)
2920
- expect(x.procedure).to be_instance_of(Expressir::Model::Ref)
2921
- expect(x.procedure.id).to eq("REMOVE")
2922
- end
2923
-
2924
- functions.find{|x| x.id == "repeatStatement"}.statements[0].tap do |x|
2925
- expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2926
- expect(x.statements).to be_instance_of(Array)
2927
- expect(x.statements.count).to eq(1)
2928
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2929
- end
2930
-
2931
- functions.find{|x| x.id == "repeatVariableStatement"}.statements[0].tap do |x|
2932
- expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2933
- expect(x.id).to eq("test")
2934
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
2935
- expect(x.bound1.value).to eq("1")
2936
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
2937
- expect(x.bound2.value).to eq("9")
2938
- expect(x.statements).to be_instance_of(Array)
2939
- expect(x.statements.count).to eq(1)
2940
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2941
- end
2942
-
2943
- functions.find{|x| x.id == "repeatVariableIncrementStatement"}.statements[0].tap do |x|
2944
- expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2945
- expect(x.id).to eq("test")
2946
- expect(x.bound1).to be_instance_of(Expressir::Model::Literals::Integer)
2947
- expect(x.bound1.value).to eq("1")
2948
- expect(x.bound2).to be_instance_of(Expressir::Model::Literals::Integer)
2949
- expect(x.bound2.value).to eq("9")
2950
- expect(x.increment).to be_instance_of(Expressir::Model::Literals::Integer)
2951
- expect(x.increment.value).to eq("2")
2952
- expect(x.statements).to be_instance_of(Array)
2953
- expect(x.statements.count).to eq(1)
2954
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2955
- end
2956
-
2957
- functions.find{|x| x.id == "repeatWhileStatement"}.statements[0].tap do |x|
2958
- expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2959
- expect(x.while_expression).to be_instance_of(Expressir::Model::Literals::Logical)
2960
- expect(x.while_expression.value).to eq(true)
2961
- expect(x.statements).to be_instance_of(Array)
2962
- expect(x.statements.count).to eq(1)
2963
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2964
- end
2965
-
2966
- functions.find{|x| x.id == "repeatUntilStatement"}.statements[0].tap do |x|
2967
- expect(x).to be_instance_of(Expressir::Model::Statements::Repeat)
2968
- expect(x.until_expression).to be_instance_of(Expressir::Model::Literals::Logical)
2969
- expect(x.until_expression.value).to eq(true)
2970
- expect(x.statements).to be_instance_of(Array)
2971
- expect(x.statements.count).to eq(1)
2972
- expect(x.statements[0]).to be_instance_of(Expressir::Model::Statements::Null)
2973
- end
2974
-
2975
- functions.find{|x| x.id == "returnStatement"}.statements[0].tap do |x|
2976
- expect(x).to be_instance_of(Expressir::Model::Statements::Return)
2977
- expect(x.expression).to be_instance_of(Expressir::Model::Literals::Logical)
2978
- expect(x.expression.value).to eq(true)
2979
- end
2980
-
2981
- functions.find{|x| x.id == "skipStatement"}.statements[0].tap do |x|
2982
- expect(x).to be_instance_of(Expressir::Model::Statements::Skip)
2983
- end
2984
- end
2985
- end
2986
-
2987
- def sample_file
2988
- @sample_file ||= Expressir.root_path.join(
2989
- "original", "examples", "syntax", "syntax.exp"
2990
- )
2991
- end
2992
- end