finitio 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46d8b55dce1f11c02ca0a953a8688fe6f6e66851
4
- data.tar.gz: 9278c34a8fc3e05e89b05a9925539dabfbbc1ca5
3
+ metadata.gz: 2a0323f2adb7a1633153813167df123264370f86
4
+ data.tar.gz: 610d4134c0eb64b1b3b2c1b525ed70a87a86d2df
5
5
  SHA512:
6
- metadata.gz: dfc507bf5246aa52b6d54743ff88aad279e2aa0c8bcef499740484e13c977ebfdc751e3d0a3ca2d1daa48fc50fe565b9e98e74b6ee28edea4b5892f2091d4f14
7
- data.tar.gz: ac994264f34c3c161c7a1a962ce57c28be8fc18235737cd9000ba26ff3b661fcca6fe16ec0e9e382cfb228093b010f9637c25ecf886f9ac88705d3941140693f
6
+ metadata.gz: 67d9b094d0f0b18ace3261583232c560ef696d13d5651a378b7c84b938a9c4e253b29804c151ac7eb2c7a5e2ef933fae4372bec8e2c48439a99041e1894d346c
7
+ data.tar.gz: e4bfed73b3a3921cb288a0f43fd3109f1ba0afeecdfd8549d5c2e3aff4349fe7aef946e1511d79ffe023151af64bc5cc51127ec97f8d91443b60dc502ddf2d50
@@ -1,4 +1,8 @@
1
- # 0.5.1 / 2017-01-08
1
+ # 0.6.0 / 2018-02-17
2
+
3
+ * Add support for typed extra attributes, e.g. { ...: Integer }
4
+
5
+ # 0.5.2 / 2017-01-08
2
6
 
3
7
  * Disable memoization in parser because it leads to terrible performance
4
8
  issues on some schemas.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- finitio (0.5.1)
4
+ finitio (0.6.0)
5
5
  citrus (>= 2.4, < 4.0)
6
6
 
7
7
  GEM
@@ -66,3 +66,6 @@ DEPENDENCIES
66
66
  path (~> 1.3)
67
67
  rake (~> 10.0)
68
68
  rspec (~> 3.0)
69
+
70
+ BUNDLED WITH
71
+ 1.16.0
@@ -11,6 +11,8 @@ module Finitio
11
11
 
12
12
  IDENTITY = ->(object){ object }
13
13
 
14
+ ANY_TYPE = AnyType.new
15
+
14
16
  def parse(source)
15
17
  require "finitio/syntax"
16
18
  Syntax.parse(source)
@@ -38,8 +38,13 @@ module Finitio
38
38
  end
39
39
 
40
40
  def allow_extra?
41
+ !!options[:allow_extra]
42
+ end
43
+
44
+ def allow_extra
41
45
  options[:allow_extra]
42
46
  end
47
+ alias :extra_type :allow_extra
43
48
 
44
49
  def each(&bl)
45
50
  return to_enum unless bl
@@ -51,6 +56,7 @@ module Finitio
51
56
  if allow_extra?
52
57
  name << ", " unless empty?
53
58
  name << "..."
59
+ name << ": #{allow_extra.name}" unless allow_extra == ANY_TYPE
54
60
  end
55
61
  name
56
62
  end
@@ -88,9 +94,16 @@ module Finitio
88
94
  end
89
95
 
90
96
  def normalize_options(opts)
91
- options = DEFAULT_OPTIONS
92
- options = options.merge(opts).freeze if opts
93
- options
97
+ options = DEFAULT_OPTIONS.dup
98
+ options = options.merge(opts) if opts
99
+ options[:allow_extra] = case extra = options[:allow_extra]
100
+ when TrueClass then ANY_TYPE
101
+ when NilClass, FalseClass then nil
102
+ when Type then extra
103
+ else
104
+ raise ArgumentError, "Unrecognized allow_extra: #{extra}"
105
+ end
106
+ options.freeze
94
107
  end
95
108
 
96
109
  end # class Heading
@@ -5,6 +5,7 @@ require_relative 'type/main_type'
5
5
  require_relative 'type/expression'
6
6
  require_relative 'type/attribute'
7
7
  require_relative 'type/heading'
8
+ require_relative 'type/heading_extra'
8
9
  require_relative 'type/any_type'
9
10
  require_relative 'type/builtin_type'
10
11
  require_relative 'type/sub_type'
@@ -18,11 +18,14 @@ module Finitio
18
18
  end
19
19
 
20
20
  def compile(factory)
21
- Finitio::Heading.new(attributes(factory), allow_extra: allow_extra?)
21
+ options = allow_extra ? allow_extra.compile(factory) : {}
22
+ Finitio::Heading.new(attributes(factory), options)
22
23
  end
23
24
 
24
25
  def to_ast
25
- captures[:attribute].map(&:to_ast).unshift(:heading)
26
+ ast = captures[:attribute].map(&:to_ast).unshift(:heading)
27
+ ast << allow_extra.to_ast if allow_extra
28
+ ast
26
29
  end
27
30
 
28
31
  end # module Heading
@@ -0,0 +1,18 @@
1
+ module Finitio
2
+ module Syntax
3
+ module HeadingExtra
4
+ include Node
5
+
6
+ capture :extra_type
7
+
8
+ def compile(factory)
9
+ { allow_extra: extra_type ? extra_type.compile(factory) : true }
10
+ end
11
+
12
+ def to_ast
13
+ { allow_extra: extra_type ? extra_type.to_ast : true }
14
+ end
15
+
16
+ end # module HeadingExtra
17
+ end # module Syntax
18
+ end # module Finitio
@@ -72,10 +72,15 @@ grammar Finitio::Syntax::Types
72
72
  end
73
73
 
74
74
  rule heading
75
- (attribute? (opt_comma attribute)* (opt_comma allow_extra:dots)? opt_comma?)
75
+ (attribute? (opt_comma attribute)* (opt_comma allow_extra:heading_extra)? opt_comma?)
76
76
  <Finitio::Syntax::Heading>
77
77
  end
78
78
 
79
+ rule heading_extra
80
+ (dots (':' spacing extra_type:type)?)
81
+ <Finitio::Syntax::HeadingExtra>
82
+ end
83
+
79
84
  rule attribute
80
85
  (metadata? attribute_name spacing multiplicity:(':?' | ':') spacing type)
81
86
  <Finitio::Syntax::Attribute>
@@ -11,10 +11,11 @@ module Finitio
11
11
 
12
12
  def include?(value)
13
13
  value.is_a?(Hash) &&
14
- valid_attrs?(value) &&
15
14
  heading.all?{|a|
16
15
  value.has_key?(a.name) ? a.type.include?(value[a.name]) : true
17
- }
16
+ } &&
17
+ !missing_attr?(value) &&
18
+ valid_extra_attrs?(value)
18
19
  end
19
20
 
20
21
  # Convert `value` (supposed to be Hash) to a Tuple, by checking attributes
@@ -23,11 +24,6 @@ module Finitio
23
24
  def dress(value, handler = DressHelper.new)
24
25
  handler.failed!(self, value) unless looks_a_tuple?(value)
25
26
 
26
- # Check for extra attributes
27
- unless heading.allow_extra? or (extra = extra_attrs(value, true)).empty?
28
- handler.fail!("Unrecognized attribute `#{extra.first}`")
29
- end
30
-
31
27
  # Check for missing attributes
32
28
  unless (missing = missing_attrs(value, true)).empty?
33
29
  handler.fail!("Missing attribute `#{missing.first}`")
@@ -36,6 +32,21 @@ module Finitio
36
32
  # Uped values, i.e. tuple under construction
37
33
  uped = {}
38
34
 
35
+ # Check for extra attributes
36
+ extra = extra_attrs(value, true)
37
+ case extra_type = heading.extra_type
38
+ when NilClass
39
+ handler.fail!("Unrecognized attribute `#{extra.first}`") unless extra.empty?
40
+ when ANY_TYPE
41
+ # ok, nothing to do
42
+ else
43
+ extra.each do |attr|
44
+ handler.deeper(attr) do
45
+ uped[attr.to_sym] = extra_type.dress(value.fetch(attr), handler)
46
+ end
47
+ end
48
+ end
49
+
39
50
  # Up each attribute in turn now. Fail on missing ones.
40
51
  heading.each do |attribute|
41
52
  present = true
@@ -71,10 +82,6 @@ module Finitio
71
82
  attrs(value.keys, to_s) - attrs(attr_names, to_s)
72
83
  end
73
84
 
74
- def extra_attr?(value, to_s = false)
75
- !extra_attrs(value, to_s).empty?
76
- end
77
-
78
85
  def missing_attrs(value, to_s = false)
79
86
  attrs(req_attr_names, to_s) - attrs(value.keys, to_s)
80
87
  end
@@ -83,8 +90,12 @@ module Finitio
83
90
  !missing_attrs(value, to_s).empty?
84
91
  end
85
92
 
86
- def valid_attrs?(value, to_s = false)
87
- (heading.allow_extra? || !extra_attr?(value, to_s)) && !missing_attr?(value)
93
+ def valid_extra_attrs?(value)
94
+ extra = self.extra_attrs(value)
95
+ return extra.empty? unless heading.allow_extra?
96
+ extra_type = heading.extra_type
97
+ return true if extra_type == ANY_TYPE
98
+ extra.all?{|attr| extra_type.include?(value[attr]) }
88
99
  end
89
100
 
90
101
  end # module HashBasedType
@@ -2,8 +2,8 @@ module Finitio
2
2
  module Version
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 5
6
- TINY = 2
5
+ MINOR = 6
6
+ TINY = 0
7
7
 
8
8
  def self.to_s
9
9
  [ MAJOR, MINOR, TINY ].join('.')
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
  module Finitio
3
- describe Heading, "allow_extra" do
3
+ describe Heading, "allow_extra? and allow_extra" do
4
4
 
5
5
  let(:r){ Attribute.new(:r, intType) }
6
6
 
@@ -10,14 +10,26 @@ module Finitio
10
10
 
11
11
  it 'is false by default' do
12
12
  expect(heading([r])).not_to be_allow_extra
13
+ expect(heading([r]).allow_extra).to be_nil
14
+ expect(heading([r]).extra_type).to be_nil
13
15
  end
14
16
 
15
17
  it 'can be set to true' do
16
18
  expect(heading([r], allow_extra: true)).to be_allow_extra
19
+ expect(heading([r], allow_extra: true).allow_extra).to eq(anyType)
20
+ expect(heading([r], allow_extra: true).extra_type).to eq(anyType)
17
21
  end
18
22
 
19
23
  it 'can be set to false explicitely' do
20
24
  expect(heading([r], allow_extra: false)).not_to be_allow_extra
25
+ expect(heading([r]).allow_extra).to be_nil
26
+ expect(heading([r]).extra_type).to be_nil
27
+ end
28
+
29
+ it 'can be set to an explicit type' do
30
+ expect(heading([r], allow_extra: intType)).to be_allow_extra
31
+ expect(heading([r], allow_extra: intType).allow_extra).to eql(intType)
32
+ expect(heading([r], allow_extra: intType).extra_type).to eql(intType)
21
33
  end
22
34
 
23
35
  end
@@ -25,7 +25,13 @@ module Finitio
25
25
  it 'distinguishes between extra allowance' do
26
26
  h1 = heading([r], allow_extra: true)
27
27
  h2 = heading([r], allow_extra: false)
28
+ h3 = heading([r], allow_extra: anyType)
29
+ h4 = heading([r], allow_extra: intType)
30
+ h5 = heading([r], allow_extra: intType)
28
31
  expect(h1).not_to eq(h2)
32
+ expect(h1).to eq(h3)
33
+ expect(h1).not_to eq(h4)
34
+ expect(h4).to eq(h5)
29
35
  end
30
36
 
31
37
  it 'distinguishes between attribute types' do
@@ -25,7 +25,13 @@ module Finitio
25
25
  it 'is good enough to distinguish between extra allowance' do
26
26
  h1 = heading([r], allow_extra: true)
27
27
  h2 = heading([r], allow_extra: false)
28
+ h3 = heading([r], allow_extra: anyType)
29
+ h4 = heading([r], allow_extra: intType)
30
+ h5 = heading([r], allow_extra: intType)
28
31
  expect(h1.hash).not_to eq(h2.hash)
32
+ expect(h1.hash).to eq(h3.hash)
33
+ expect(h1.hash).not_to eq(h4.hash)
34
+ expect(h4.hash).to eq(h5.hash)
29
35
  end
30
36
 
31
37
  it 'is be good enough to distinguish between different headings' do
@@ -53,5 +53,16 @@ module Finitio
53
53
  it{ should eq(true) }
54
54
  end
55
55
 
56
+ context 'with allow_extra set to a type' do
57
+ let(:attributes){
58
+ [ red, blue ]
59
+ }
60
+ let(:options){
61
+ {allow_extra: intType}
62
+ }
63
+
64
+ it{ should eq(true) }
65
+ end
66
+
56
67
  end
57
68
  end
@@ -48,6 +48,12 @@ module Finitio
48
48
  it{ should eq('red: intType, ...') }
49
49
  end
50
50
 
51
+ context 'when allowing extra to a type' do
52
+ let(:heading){ Heading.new([red], allow_extra: intType) }
53
+
54
+ it{ should eq('red: intType, ...: intType') }
55
+ end
56
+
51
57
  context 'when allowing extra only' do
52
58
  let(:heading){ Heading.new([], allow_extra: true) }
53
59
 
@@ -44,6 +44,10 @@ end
44
44
 
45
45
  module SpecHelpers
46
46
 
47
+ def anyType
48
+ Finitio::AnyType.new
49
+ end
50
+
47
51
  def intType
48
52
  Finitio::BuiltinType.new(Integer, "intType")
49
53
  end
@@ -72,10 +76,22 @@ module SpecHelpers
72
76
  @positive ||= Finitio::Constraint.new(->(i){ i>=0 }, :positive)
73
77
  end
74
78
 
79
+ def negative
80
+ @negative ||= Finitio::Constraint.new(->(i){ i<0 }, :negative)
81
+ end
82
+
75
83
  def byte
76
84
  Finitio::SubType.new(intType, [byte_full])
77
85
  end
78
86
 
87
+ def posInt
88
+ Finitio::SubType.new(intType, [positive])
89
+ end
90
+
91
+ def negInt
92
+ Finitio::SubType.new(intType, [negative])
93
+ end
94
+
79
95
  def type_factory
80
96
  Finitio::TypeFactory.new
81
97
  end
@@ -55,22 +55,60 @@ module Finitio
55
55
  expect(compiled.to_name).to eq('a: Integer, ...')
56
56
  end
57
57
  end
58
+
59
+ context 'a: .Integer, ...: .String' do
60
+ let(:input){ 'a: .Integer, ...: .String' }
61
+
62
+ it 'compiles to a Heading' do
63
+ expect(compiled).to be_a(Heading)
64
+ expect(compiled.to_name).to eq('a: Integer, ...: String')
65
+ end
66
+ end
58
67
  end
59
68
 
60
69
  describe "AST" do
61
- let(:input){ 'a: .Integer, b: .Float' }
62
70
 
63
71
  let(:ast){
64
72
  subject.to_ast
65
73
  }
66
74
 
67
- it{
68
- expect(ast).to eq([
69
- :heading,
70
- [ :attribute, "a", [:builtin_type, "Integer" ]],
71
- [ :attribute, "b", [:builtin_type, "Float" ]]
72
- ])
73
- }
75
+ context 'when not using allow extra' do
76
+ let(:input){ 'a: .Integer, b: .Float' }
77
+
78
+ it{
79
+ expect(ast).to eq([
80
+ :heading,
81
+ [ :attribute, "a", [:builtin_type, "Integer" ]],
82
+ [ :attribute, "b", [:builtin_type, "Float" ]]
83
+ ])
84
+ }
85
+ end
86
+
87
+ context 'when specifying allow extra without type' do
88
+ let(:input){ 'a: .Integer, b: .Float, ...' }
89
+
90
+ it{
91
+ expect(ast).to eq([
92
+ :heading,
93
+ [ :attribute, "a", [:builtin_type, "Integer" ]],
94
+ [ :attribute, "b", [:builtin_type, "Float" ]],
95
+ { allow_extra: true }
96
+ ])
97
+ }
98
+ end
99
+
100
+ context 'when specifying allow extra type' do
101
+ let(:input){ 'a: .Integer, b: .Float, ...: .String' }
102
+
103
+ it{
104
+ expect(ast).to eq([
105
+ :heading,
106
+ [ :attribute, "a", [:builtin_type, "Integer" ]],
107
+ [ :attribute, "b", [:builtin_type, "Float" ]],
108
+ { allow_extra: [:builtin_type, "String"] }
109
+ ])
110
+ }
111
+ end
74
112
  end
75
113
  end
76
114
  end
@@ -122,7 +122,7 @@ module Finitio
122
122
  end
123
123
  end
124
124
 
125
- context 'when not allowing extra' do
125
+ context 'when allow_extra is set to true' do
126
126
  let(:heading){
127
127
  Heading.new([r, g, maybe_b], allow_extra: true)
128
128
  }
@@ -142,5 +142,39 @@ module Finitio
142
142
  end
143
143
  end
144
144
 
145
+ context 'when allow_extra is set to a specific type' do
146
+ let(:heading){
147
+ Heading.new([r, g, maybe_b], allow_extra: negInt)
148
+ }
149
+
150
+ subject do
151
+ type.dress(arg) rescue $!
152
+ end
153
+
154
+ context 'with an invalid extra attribute' do
155
+ let(:arg){
156
+ { "r" => 12, "g" => 13, "extr" => 165 }
157
+ }
158
+
159
+ it 'should raise a TypeError' do
160
+ expect(subject).to be_a(TypeError)
161
+ end
162
+ end
163
+
164
+ context 'with a valid extra attribute' do
165
+ let(:arg){
166
+ { "r" => 12, "g" => 13, "extr" => -165 }
167
+ }
168
+
169
+ it 'should not raise a TypeError' do
170
+ expect(subject).not_to be_a(TypeError)
171
+ end
172
+
173
+ it 'should return a coerced/projection' do
174
+ expect(subject).to eq(r: 12, g: 13, extr: -165)
175
+ end
176
+ end
177
+ end
178
+
145
179
  end
146
180
  end
@@ -51,7 +51,7 @@ module Finitio
51
51
  end
52
52
  end
53
53
 
54
- context 'with extra allowed' do
54
+ context 'with allow_extra set to true' do
55
55
  let(:heading){
56
56
  Heading.new([a, maybe_b], allow_extra: true)
57
57
  }
@@ -69,5 +69,35 @@ module Finitio
69
69
  end
70
70
  end
71
71
 
72
+ context 'with allow_extra set to a specific type' do
73
+ let(:heading){
74
+ Heading.new([a, maybe_b], allow_extra: negInt)
75
+ }
76
+
77
+ context 'when valid hash, yet with no extra attribute' do
78
+ let(:arg){ {a: 12} }
79
+
80
+ it{ should eq(true) }
81
+ end
82
+
83
+ context 'when a valid b' do
84
+ let(:arg){ {a: 12, b: 15} }
85
+
86
+ it{ should eq(true) }
87
+ end
88
+
89
+ context 'when a valid c' do
90
+ let(:arg){ {a: 12, b: 15, c: -120} }
91
+
92
+ it{ should eq(true) }
93
+ end
94
+
95
+ context 'when an invalid c' do
96
+ let(:arg){ {a: 12, b: 15, c: 120} }
97
+
98
+ it{ should eq(false) }
99
+ end
100
+ end
101
+
72
102
  end
73
103
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2018-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citrus
@@ -95,6 +95,7 @@ files:
95
95
  - lib/finitio/syntax/type/expression.rb
96
96
  - lib/finitio/syntax/type/external_pair.rb
97
97
  - lib/finitio/syntax/type/heading.rb
98
+ - lib/finitio/syntax/type/heading_extra.rb
98
99
  - lib/finitio/syntax/type/inline_pair.rb
99
100
  - lib/finitio/syntax/type/lambda_expr.rb
100
101
  - lib/finitio/syntax/type/main_type.rb
@@ -311,164 +312,164 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
312
  version: '0'
312
313
  requirements: []
313
314
  rubyforge_project:
314
- rubygems_version: 2.4.5
315
+ rubygems_version: 2.5.2
315
316
  signing_key:
316
317
  specification_version: 4
317
318
  summary: Finitio - in Ruby
318
319
  test_files:
320
+ - spec/spec_helper.rb
321
+ - spec/type_factory/factory/test_tuple_type.rb
322
+ - spec/type_factory/factory/test_builtin.rb
323
+ - spec/type_factory/factory/test_set_type.rb
324
+ - spec/type_factory/factory/test_struct_type.rb
325
+ - spec/type_factory/factory/test_sub_type.rb
326
+ - spec/type_factory/factory/test_seq_type.rb
327
+ - spec/type_factory/dsl/test_attributes.rb
328
+ - spec/type_factory/dsl/test_builtin.rb
329
+ - spec/type_factory/dsl/test_adt.rb
330
+ - spec/type_factory/dsl/test_multi_tuple.rb
331
+ - spec/type_factory/dsl/test_seq.rb
332
+ - spec/type_factory/dsl/test_multi_relation.rb
333
+ - spec/type_factory/dsl/test_tuple.rb
334
+ - spec/type_factory/dsl/test_set.rb
335
+ - spec/type_factory/dsl/test_attribute.rb
336
+ - spec/type_factory/dsl/test_any.rb
337
+ - spec/type_factory/dsl/test_union.rb
338
+ - spec/type_factory/dsl/test_struct.rb
339
+ - spec/type_factory/dsl/test_relation.rb
340
+ - spec/type_factory/dsl/test_subtype.rb
341
+ - spec/attribute/test_initialize.rb
319
342
  - spec/attribute/test_equality.rb
343
+ - spec/attribute/test_to_name.rb
320
344
  - spec/attribute/test_fetch_on.rb
321
- - spec/attribute/test_initialize.rb
322
345
  - spec/attribute/test_optional.rb
323
346
  - spec/attribute/test_required.rb
324
- - spec/attribute/test_to_name.rb
325
- - spec/constraint/test_anonymous.rb
326
- - spec/constraint/test_equality.rb
327
- - spec/constraint/test_name.rb
328
- - spec/constraint/test_named.rb
329
- - spec/constraint/test_triple_equal.rb
330
- - spec/finitio/system.fio
331
- - spec/finitio/test_ast.rb
332
- - spec/finitio/test_parse.rb
333
- - spec/finitio/test_system.rb
334
- - spec/heading/test_allow_extra.rb
335
- - spec/heading/test_each.rb
336
- - spec/heading/test_equality.rb
337
- - spec/heading/test_hash.rb
338
347
  - spec/heading/test_hash_get.rb
339
348
  - spec/heading/test_initialize.rb
349
+ - spec/heading/test_equality.rb
350
+ - spec/heading/test_to_name.rb
340
351
  - spec/heading/test_multi.rb
352
+ - spec/heading/test_hash.rb
353
+ - spec/heading/test_allow_extra.rb
341
354
  - spec/heading/test_size.rb
342
- - spec/heading/test_to_name.rb
343
- - spec/spec_helper.rb
344
- - spec/syntax/expr/test_free_variables.rb
345
- - spec/syntax/expr/test_to_proc_source.rb
346
- - spec/syntax/nodes/test_ad_type.rb
347
- - spec/syntax/nodes/test_any_type.rb
348
- - spec/syntax/nodes/test_attribute.rb
349
- - spec/syntax/nodes/test_builtin_type.rb
350
- - spec/syntax/nodes/test_comment.rb
351
- - spec/syntax/nodes/test_constraint_def.rb
352
- - spec/syntax/nodes/test_constraints.rb
353
- - spec/syntax/nodes/test_contract.rb
354
- - spec/syntax/nodes/test_expression.rb
355
- - spec/syntax/nodes/test_heading.rb
356
- - spec/syntax/nodes/test_metadata.rb
357
- - spec/syntax/nodes/test_named_constraint.rb
358
- - spec/syntax/nodes/test_relation_type.rb
359
- - spec/syntax/nodes/test_seq_type.rb
360
- - spec/syntax/nodes/test_set_type.rb
361
- - spec/syntax/nodes/test_spacing.rb
362
- - spec/syntax/nodes/test_struct_type.rb
363
- - spec/syntax/nodes/test_sub_type.rb
364
- - spec/syntax/nodes/test_system.rb
365
- - spec/syntax/nodes/test_tuple_type.rb
366
- - spec/syntax/nodes/test_type_def.rb
367
- - spec/syntax/nodes/test_type_ref.rb
368
- - spec/syntax/nodes/test_union_type.rb
369
- - spec/syntax/nodes/test_unnamed_constraint.rb
370
- - spec/syntax/test_compile.rb
371
- - spec/syntax/test_compile_type.rb
355
+ - spec/heading/test_each.rb
356
+ - spec/test_finitio.rb
357
+ - spec/finitio/test_ast.rb
358
+ - spec/finitio/system.fio
359
+ - spec/finitio/test_system.rb
360
+ - spec/finitio/test_parse.rb
361
+ - spec/system/test_initialize.rb
362
+ - spec/system/test_get_type.rb
363
+ - spec/system/test_fetch.rb
364
+ - spec/system/test_dup.rb
372
365
  - spec/system/test_add_type.rb
373
366
  - spec/system/test_dsl.rb
374
- - spec/system/test_dup.rb
375
- - spec/system/test_fetch.rb
376
- - spec/system/test_get_type.rb
377
- - spec/system/test_initialize.rb
378
- - spec/test_finitio.rb
367
+ - spec/type/multi_relation_type/test_name.rb
368
+ - spec/type/multi_relation_type/test_initialize.rb
369
+ - spec/type/multi_relation_type/test_equality.rb
370
+ - spec/type/multi_relation_type/test_include.rb
371
+ - spec/type/multi_relation_type/test_default_name.rb
372
+ - spec/type/multi_relation_type/test_dress.rb
373
+ - spec/type/sub_type/test_name.rb
374
+ - spec/type/sub_type/test_initialize.rb
375
+ - spec/type/sub_type/test_equality.rb
376
+ - spec/type/sub_type/test_include.rb
377
+ - spec/type/sub_type/test_default_name.rb
378
+ - spec/type/sub_type/test_dress.rb
379
+ - spec/type/proxy_type/test_resolve.rb
380
+ - spec/type/proxy_type/test_delegation.rb
381
+ - spec/type/ad_type/test_name.rb
382
+ - spec/type/ad_type/test_initialize.rb
383
+ - spec/type/ad_type/test_include.rb
379
384
  - spec/type/ad_type/test_default_name.rb
380
385
  - spec/type/ad_type/test_dress.rb
381
- - spec/type/ad_type/test_include.rb
382
- - spec/type/ad_type/test_initialize.rb
383
- - spec/type/ad_type/test_name.rb
384
- - spec/type/alias_type/test_default_name.rb
385
- - spec/type/alias_type/test_delegation.rb
386
- - spec/type/alias_type/test_name.rb
387
- - spec/type/any_type/test_default_name.rb
388
- - spec/type/any_type/test_dress.rb
386
+ - spec/type/struct_type/test_name.rb
387
+ - spec/type/struct_type/test_initialize.rb
388
+ - spec/type/struct_type/test_equality.rb
389
+ - spec/type/struct_type/test_include.rb
390
+ - spec/type/struct_type/test_default_name.rb
391
+ - spec/type/struct_type/test_dress.rb
392
+ - spec/type/set_type/test_name.rb
393
+ - spec/type/set_type/test_initialize.rb
394
+ - spec/type/set_type/test_equality.rb
395
+ - spec/type/set_type/test_include.rb
396
+ - spec/type/set_type/test_default_name.rb
397
+ - spec/type/set_type/test_dress.rb
398
+ - spec/type/relation_type/test_name.rb
399
+ - spec/type/relation_type/test_initialize.rb
400
+ - spec/type/relation_type/test_equality.rb
401
+ - spec/type/relation_type/test_include.rb
402
+ - spec/type/relation_type/test_default_name.rb
403
+ - spec/type/relation_type/test_dress.rb
404
+ - spec/type/any_type/test_name.rb
405
+ - spec/type/any_type/test_initialize.rb
389
406
  - spec/type/any_type/test_equality.rb
390
407
  - spec/type/any_type/test_include.rb
391
- - spec/type/any_type/test_initialize.rb
392
- - spec/type/any_type/test_name.rb
393
- - spec/type/builtin_type/test_default_name.rb
394
- - spec/type/builtin_type/test_dress.rb
408
+ - spec/type/any_type/test_default_name.rb
409
+ - spec/type/any_type/test_dress.rb
410
+ - spec/type/builtin_type/test_name.rb
411
+ - spec/type/builtin_type/test_initialize.rb
395
412
  - spec/type/builtin_type/test_equality.rb
396
413
  - spec/type/builtin_type/test_include.rb
397
- - spec/type/builtin_type/test_initialize.rb
398
- - spec/type/builtin_type/test_name.rb
399
- - spec/type/multi_relation_type/test_default_name.rb
400
- - spec/type/multi_relation_type/test_dress.rb
401
- - spec/type/multi_relation_type/test_equality.rb
402
- - spec/type/multi_relation_type/test_include.rb
403
- - spec/type/multi_relation_type/test_initialize.rb
404
- - spec/type/multi_relation_type/test_name.rb
405
- - spec/type/multi_tuple_type/test_default_name.rb
406
- - spec/type/multi_tuple_type/test_dress.rb
407
- - spec/type/multi_tuple_type/test_equality.rb
408
- - spec/type/multi_tuple_type/test_include.rb
409
- - spec/type/multi_tuple_type/test_initialize.rb
410
- - spec/type/multi_tuple_type/test_name.rb
411
- - spec/type/proxy_type/test_delegation.rb
412
- - spec/type/proxy_type/test_resolve.rb
413
- - spec/type/relation_type/test_default_name.rb
414
- - spec/type/relation_type/test_dress.rb
415
- - spec/type/relation_type/test_equality.rb
416
- - spec/type/relation_type/test_include.rb
417
- - spec/type/relation_type/test_initialize.rb
418
- - spec/type/relation_type/test_name.rb
419
- - spec/type/seq_type/test_default_name.rb
420
- - spec/type/seq_type/test_dress.rb
421
- - spec/type/seq_type/test_equality.rb
422
- - spec/type/seq_type/test_include.rb
423
- - spec/type/seq_type/test_initialize.rb
424
- - spec/type/seq_type/test_name.rb
425
- - spec/type/set_type/test_default_name.rb
426
- - spec/type/set_type/test_dress.rb
427
- - spec/type/set_type/test_equality.rb
428
- - spec/type/set_type/test_include.rb
429
- - spec/type/set_type/test_initialize.rb
430
- - spec/type/set_type/test_name.rb
431
- - spec/type/struct_type/test_default_name.rb
432
- - spec/type/struct_type/test_dress.rb
433
- - spec/type/struct_type/test_equality.rb
434
- - spec/type/struct_type/test_include.rb
435
- - spec/type/struct_type/test_initialize.rb
436
- - spec/type/struct_type/test_name.rb
437
- - spec/type/sub_type/test_default_name.rb
438
- - spec/type/sub_type/test_dress.rb
439
- - spec/type/sub_type/test_equality.rb
440
- - spec/type/sub_type/test_include.rb
441
- - spec/type/sub_type/test_initialize.rb
442
- - spec/type/sub_type/test_name.rb
443
- - spec/type/tuple_type/test_default_name.rb
444
- - spec/type/tuple_type/test_dress.rb
445
- - spec/type/tuple_type/test_equality.rb
446
- - spec/type/tuple_type/test_include.rb
447
- - spec/type/tuple_type/test_initialize.rb
448
- - spec/type/tuple_type/test_name.rb
449
- - spec/type/union_type/test_default_name.rb
450
- - spec/type/union_type/test_dress.rb
414
+ - spec/type/builtin_type/test_default_name.rb
415
+ - spec/type/builtin_type/test_dress.rb
416
+ - spec/type/union_type/test_name.rb
417
+ - spec/type/union_type/test_initialize.rb
451
418
  - spec/type/union_type/test_equality.rb
452
419
  - spec/type/union_type/test_include.rb
453
- - spec/type/union_type/test_initialize.rb
454
- - spec/type/union_type/test_name.rb
455
- - spec/type_factory/dsl/test_adt.rb
456
- - spec/type_factory/dsl/test_any.rb
457
- - spec/type_factory/dsl/test_attribute.rb
458
- - spec/type_factory/dsl/test_attributes.rb
459
- - spec/type_factory/dsl/test_builtin.rb
460
- - spec/type_factory/dsl/test_multi_relation.rb
461
- - spec/type_factory/dsl/test_multi_tuple.rb
462
- - spec/type_factory/dsl/test_relation.rb
463
- - spec/type_factory/dsl/test_seq.rb
464
- - spec/type_factory/dsl/test_set.rb
465
- - spec/type_factory/dsl/test_struct.rb
466
- - spec/type_factory/dsl/test_subtype.rb
467
- - spec/type_factory/dsl/test_tuple.rb
468
- - spec/type_factory/dsl/test_union.rb
469
- - spec/type_factory/factory/test_builtin.rb
470
- - spec/type_factory/factory/test_seq_type.rb
471
- - spec/type_factory/factory/test_set_type.rb
472
- - spec/type_factory/factory/test_struct_type.rb
473
- - spec/type_factory/factory/test_sub_type.rb
474
- - spec/type_factory/factory/test_tuple_type.rb
420
+ - spec/type/union_type/test_default_name.rb
421
+ - spec/type/union_type/test_dress.rb
422
+ - spec/type/tuple_type/test_name.rb
423
+ - spec/type/tuple_type/test_initialize.rb
424
+ - spec/type/tuple_type/test_equality.rb
425
+ - spec/type/tuple_type/test_include.rb
426
+ - spec/type/tuple_type/test_default_name.rb
427
+ - spec/type/tuple_type/test_dress.rb
428
+ - spec/type/alias_type/test_name.rb
429
+ - spec/type/alias_type/test_default_name.rb
430
+ - spec/type/alias_type/test_delegation.rb
431
+ - spec/type/seq_type/test_name.rb
432
+ - spec/type/seq_type/test_initialize.rb
433
+ - spec/type/seq_type/test_equality.rb
434
+ - spec/type/seq_type/test_include.rb
435
+ - spec/type/seq_type/test_default_name.rb
436
+ - spec/type/seq_type/test_dress.rb
437
+ - spec/type/multi_tuple_type/test_name.rb
438
+ - spec/type/multi_tuple_type/test_initialize.rb
439
+ - spec/type/multi_tuple_type/test_equality.rb
440
+ - spec/type/multi_tuple_type/test_include.rb
441
+ - spec/type/multi_tuple_type/test_default_name.rb
442
+ - spec/type/multi_tuple_type/test_dress.rb
443
+ - spec/syntax/nodes/test_tuple_type.rb
444
+ - spec/syntax/nodes/test_set_type.rb
445
+ - spec/syntax/nodes/test_union_type.rb
446
+ - spec/syntax/nodes/test_heading.rb
447
+ - spec/syntax/nodes/test_builtin_type.rb
448
+ - spec/syntax/nodes/test_constraints.rb
449
+ - spec/syntax/nodes/test_type_ref.rb
450
+ - spec/syntax/nodes/test_system.rb
451
+ - spec/syntax/nodes/test_attribute.rb
452
+ - spec/syntax/nodes/test_contract.rb
453
+ - spec/syntax/nodes/test_named_constraint.rb
454
+ - spec/syntax/nodes/test_metadata.rb
455
+ - spec/syntax/nodes/test_type_def.rb
456
+ - spec/syntax/nodes/test_struct_type.rb
457
+ - spec/syntax/nodes/test_sub_type.rb
458
+ - spec/syntax/nodes/test_any_type.rb
459
+ - spec/syntax/nodes/test_constraint_def.rb
460
+ - spec/syntax/nodes/test_ad_type.rb
461
+ - spec/syntax/nodes/test_expression.rb
462
+ - spec/syntax/nodes/test_relation_type.rb
463
+ - spec/syntax/nodes/test_spacing.rb
464
+ - spec/syntax/nodes/test_comment.rb
465
+ - spec/syntax/nodes/test_seq_type.rb
466
+ - spec/syntax/nodes/test_unnamed_constraint.rb
467
+ - spec/syntax/expr/test_to_proc_source.rb
468
+ - spec/syntax/expr/test_free_variables.rb
469
+ - spec/syntax/test_compile.rb
470
+ - spec/syntax/test_compile_type.rb
471
+ - spec/constraint/test_name.rb
472
+ - spec/constraint/test_equality.rb
473
+ - spec/constraint/test_anonymous.rb
474
+ - spec/constraint/test_named.rb
475
+ - spec/constraint/test_triple_equal.rb