File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed
features/finitio/language/types Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1- # 0.10.1
1+ # 0.11.0
22
33* Fix json schema generation of Boolean and union types with a |Nil
4+ * Add support for dashses in attribute names (tuple & relation types).
45
56# 0.10.0 - 2021/01/11
67
Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ Feature: Support for rich tuple types
1010 And `length` and `angle` are mandatory
1111 And it does not allow extra attributes
1212
13+ Scenario : Casing of the attribute names
14+
15+ Given the System is
16+ """
17+ { a-b: Integer, a_b: Integer, aB: Integer }
18+ """
19+ Then it compiles to a tuple type
20+
1321 Scenario : Support for optional attributes
1422
1523 Given the System is
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ grammar Finitio::Syntax::Lexer
2121 end
2222
2323 rule attribute_name
24- /[a-z_][a-zA-Z0-9_]*/
24+ /[a-z_][a-zA-Z0-9_\- ]*/
2525 end
2626
2727 rule type_name
Original file line number Diff line number Diff line change @@ -34,6 +34,18 @@ module Finitio
3434 expect ( compiled ) . not_to be_required
3535 end
3636 end
37+
38+ context 'when using dashes in attribute name' do
39+ let ( :input ) { 'created-at : .Integer' }
40+
41+ it 'works' do
42+ expect ( compiled ) . to be_a ( Attribute )
43+ expect ( compiled . name ) . to eq ( :"created-at" )
44+ expect ( compiled . type ) . to be_a ( BuiltinType )
45+ expect ( compiled . type . ruby_type ) . to be ( Integer )
46+ expect ( compiled ) . to be_required
47+ end
48+ end
3749 end
3850
3951 describe 'AST' do
@@ -60,6 +72,6 @@ module Finitio
6072 end
6173
6274 end
63-
75+
6476 end
6577end
You can’t perform that action at this time.
0 commit comments