-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add tests for computed elements (#787)
Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com>
- Loading branch information
1 parent
7b4f8ae
commit f70abcb
Showing
5 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace complex.computed; | ||
|
||
entity static { | ||
value : Integer; | ||
integer : Integer = 1; | ||
double : Double = 0.1; | ||
string : String = ''; | ||
} | ||
|
||
entity dynamic { | ||
integer : Integer; | ||
@(Core.Computed: true,readonly) | ||
![case] : String = ( | ||
case | ||
when | ||
integer = 0 | ||
then | ||
'zero' | ||
when | ||
integer = 1 | ||
then | ||
'one' | ||
when | ||
integer = 2 | ||
then | ||
'two' | ||
end | ||
); | ||
lambda : String = (integer = 0 ? 'none' : 'some') | ||
} |
17 changes: 17 additions & 0 deletions
17
test/compliance/resources/db/complex/computed/complex.computed.dynamic.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = [ | ||
{ | ||
integer: 0, | ||
'=case': 'zero', | ||
'=lambda': 'none', | ||
}, | ||
{ | ||
integer: 1, | ||
'=case': 'one', | ||
'=lambda': 'some', | ||
}, | ||
{ | ||
integer: 2, | ||
'=case': 'two', | ||
'=lambda': 'some', | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
test/compliance/resources/db/complex/computed/complex.computed.static.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = [ | ||
{ | ||
'=integer': 1, | ||
'=double': 0.1, | ||
'=string': '', | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
namespace complex; | ||
|
||
using from './computed'; | ||
using from './associations'; | ||
using from './associationsUnmanaged'; |