Merge pull request #60 from mpictor/tp/tests-repository
Created a new data/tests_repository folder including three 'unit'tests fo
This commit is contained in:
commit
ac9a402470
3 changed files with 79 additions and 0 deletions
18
data/tests_repository/derived_attribute.exp
Normal file
18
data/tests_repository/derived_attribute.exp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
SCHEMA test_derived_attribute;
|
||||
|
||||
ENTITY point;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY vector;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY circle;
|
||||
centre : point;
|
||||
radius : REAL;
|
||||
axis : vector;
|
||||
DERIVE
|
||||
area : REAL := PI*radius**2;
|
||||
perimeter : REAL := 2.0*PI*radius;
|
||||
|
||||
END_ENTITY;
|
||||
END_SCHEMA;
|
||||
37
data/tests_repository/select_data_type.exp
Normal file
37
data/tests_repository/select_data_type.exp
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
SCHEMA test_select_data_type;
|
||||
|
||||
TYPE attachment_method = SELECT(permanent_attachment, temporary_attachment);
|
||||
END_TYPE;
|
||||
|
||||
TYPE permanent_attachment = SELECT(glue, weld);
|
||||
END_TYPE;
|
||||
|
||||
TYPE temporary_attachment = SELECT(nail, screw);
|
||||
END_TYPE;
|
||||
|
||||
ENTITY nail;
|
||||
body_length : REAL;
|
||||
head_area : REAL;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY screw;
|
||||
body_length : REAL;
|
||||
pitch : REAL;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY glue;
|
||||
composition : STRING;
|
||||
solvent : STRING;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY weld;
|
||||
composition : STRING;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY wall_mounting;
|
||||
mounting : STRING;
|
||||
on : STRING;
|
||||
using : attachment_method;
|
||||
END_ENTITY;
|
||||
|
||||
END_SCHEMA;
|
||||
24
data/tests_repository/single_inheritance.exp
Normal file
24
data/tests_repository/single_inheritance.exp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
SCHEMA test_single_inheritance;
|
||||
|
||||
TYPE label = STRING;
|
||||
END_TYPE;
|
||||
|
||||
TYPE length_measure = REAL;
|
||||
END_TYPE;
|
||||
|
||||
TYPE point = REAL;
|
||||
END_TYPE;
|
||||
|
||||
ENTITY shape
|
||||
SUPERTYPE OF (rectangle);
|
||||
item_name : label;
|
||||
number_of_sides : INTEGER;
|
||||
END_ENTITY;
|
||||
|
||||
ENTITY rectangle
|
||||
SUBTYPE OF (shape);
|
||||
height : length_measure;
|
||||
width : length_measure;
|
||||
END_ENTITY;
|
||||
|
||||
END_SCHEMA;
|
||||
Loading…
Reference in a new issue