Skip to content

Commit 859d4ba

Browse files
committed
ST6RI-818 Updated KerML and SysML Xpect tests.
1 parent eb3e26d commit 859d4ba

24 files changed

Lines changed: 499 additions & 464 deletions

org.omg.kerml.xpect.tests/library/BaseFunctions.kerml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ standard library package BaseFunctions {
4545

4646
abstract function 'istype'{
4747
in seq: Anything[0..*];
48-
abstract feature 'type': Anything;
48+
in 'type': Anything;
4949
return : Boolean[1];
5050
}
5151

5252
abstract function 'hastype'{
5353
in seq: Anything[0..*];
54-
abstract feature 'type': Anything;
54+
in 'type': Anything;
5555
return : Boolean;
5656
}
5757

5858
abstract function '@'{
5959
in seq: Anything[0..*];
60-
abstract feature 'type': Anything;
60+
in 'type': Anything;
6161
return : Boolean[1];
6262
}
6363

6464
abstract function '@@'{
6565
in seq: Metaobject[0..*];
66-
abstract feature 'type': Metaobject;
66+
in 'type': Metaobject;
6767
return : Boolean[1];
6868
}
6969

org.omg.kerml.xpect.tests/library/CollectionFunctions.kerml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ standard library package CollectionFunctions {
5757
private feature n : Natural[1] = arr.rank;
5858

5959
// Assumes row-major ordering for elements.
60-
private function index { in arr: Array[1]; i : Natural; indexes : Positive[1..*];
60+
private function index { in arr: Array[1]; in i : Natural; in indexes : Positive[1..*];
6161
if i <= 1? indexes#(1) else arr.dimensions#(i) * (index(arr, i-1, indexes) - 1) + indexes#(i)
6262
}
6363

org.omg.kerml.xpect.tests/library/KerML.kerml

Lines changed: 210 additions & 210 deletions
Large diffs are not rendered by default.

org.omg.kerml.xpect.tests/library/Performances.kerml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,16 @@ standard library package Performances {
201201
*/
202202
}
203203

204+
abstract expr constructorEvaluations [0..*] nonunique subsets evaluations {
205+
doc
206+
/*
207+
* constructorEvaluations is a specialization of evaluations that restricts the multiplicity
208+
* of its result parameter to 1..1, requiring a constructorEvaluation to result in a single value.
209+
*/
210+
211+
return result [1..1];
212+
}
213+
204214
abstract expr booleanEvaluations: BooleanEvaluation[0..*] nonunique subsets evaluations {
205215
doc
206216
/*

org.omg.kerml.xpect.tests/library/Triggers.kerml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ standard library package Triggers {
7575
*/
7676
}
7777

78-
return feature changeSignal : ChangeSignal[1] = ChangeSignal(condition, monitor) {
78+
return feature changeSignal : ChangeSignal[1] = new ChangeSignal(condition, monitor) {
7979
doc
8080
/*
8181
* The ChangeSignal for the condition, as monitored by the monitor.
@@ -125,7 +125,7 @@ standard library package Triggers {
125125
*/
126126
}
127127

128-
return feature timeSignal : TimeSignal[1] = TimeSignal(timeInstant, clock, monitor) {
128+
return feature timeSignal : TimeSignal[1] = new TimeSignal(timeInstant, clock, monitor) {
129129
doc
130130
/*
131131
* The TimeSignal for the given timeInstant, as monitored by the monitor.

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/parsing/ParsingTests_Behaviors.kerml.xt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
66
File {from ="/library/Links.kerml"}
77
File {from ="/library/Occurrences.kerml"}
88
File {from ="/library/Performances.kerml"}
9+
File {from ="/library/ControlFunctions.kerml"}
910
}
1011
Workspace {
1112
JavaProject {
@@ -15,6 +16,7 @@ XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
1516
File {from ="/library/Links.kerml"}
1617
File {from ="/library/Occurrences.kerml"}
1718
File {from ="/library/Performances.kerml"}
19+
File {from ="/library/ControlFunctions.kerml"}
1820
}
1921
}
2022
}

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/parsing/ParsingTests_Expressions.kerml.xt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ package Expressions {
114114
feature count : ScalarValues::Integer = c#(1).count;
115115
}
116116

117-
feature l = L();
117+
feature l = new L();
118118
feature w1 = w(xx);
119119
}

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/parsing/ParsingTests_Indexing.kerml.xt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
99
File {from ="/library/ScalarValues.kerml"}
1010
File {from ="/library/Collections.kerml"}
1111
File {from ="/library/BaseFunctions.kerml"}
12+
File {from ="/library/ControlFunctions.kerml"}
1213
}
1314
Workspace {
1415
JavaProject {
@@ -21,6 +22,7 @@ XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
2122
File {from ="/library/ScalarValues.kerml"}
2223
File {from ="/library/Collections.kerml"}
2324
File {from ="/library/BaseFunctions.kerml"}
25+
File {from ="/library/ControlFunctions.kerml"}
2426
}
2527
}
2628
}

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/validation/MetadataTests_MetadataFeature_invalid.kerml.xt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ package MetadataFeatureTest {
5656
filter ~A::z;
5757
// XPECT errors --> "Must be model-level evaluable" at "filter A::y->ControlFunctions::collect {in x; x};"
5858
filter A::y->ControlFunctions::collect {in x; x};
59-
// XPECT errors --> "Must have a Boolean result" at "filter A(null, 1, "", false);"
60-
filter A(null, 1, "", false);
59+
// XPECT errors --> "Must have a Boolean result" at "filter new A(null, 1, "", false);"
60+
filter new A(null, 1, "", false);
6161

6262
feature bad;
6363

org.omg.sysml.xpect.tests/library.domain/Analysis/SampledFunctions.sysml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ standard library package SampledFunctions {
7272

7373
in calc calculation { in x; }
7474
in attribute domainValues [0..*];
75-
return sampling = SampledFunction (
76-
samples = domainValues->collect { in x; SamplePair(x, calculation(x)) }
75+
return sampling = new SampledFunction (
76+
samples = domainValues->collect { in x; new SamplePair(x, calculation(x)) }
7777
);
7878
}
7979

0 commit comments

Comments
 (0)