Skip to content

Commit 2c7efac

Browse files
committed
KERML_-57 Added Xpect tests.
1 parent 5f0b46c commit 2c7efac

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//*
2+
XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
3+
ResourceSet {
4+
ThisFile {}
5+
File {from ="/library/Base.kerml"}
6+
File {from ="/library/Links.kerml"}
7+
File {from ="/library/Occurrences.kerml"}
8+
File {from ="/library/Objects.kerml"}
9+
10+
}
11+
Workspace {
12+
JavaProject {
13+
SrcFolder {
14+
ThisFile {}
15+
File {from ="/library/Base.kerml"}
16+
File {from ="/library/Links.kerml"}
17+
File {from ="/library/Occurrences.kerml"}
18+
File {from ="/library/Objects.kerml"}
19+
20+
}
21+
}
22+
}
23+
END_SETUP
24+
*/
25+
26+
package Feature_variable_invalid {
27+
28+
class C {
29+
var feature x;
30+
// XPECT errors ---> "A portion cannot be variable" at "portion var feature y;"
31+
portion var feature y;
32+
}
33+
34+
datatype D {
35+
// XPECT errors ---> "Must be owned by an occurrence type" at "var feature z;"
36+
var feature z;
37+
}
38+
39+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//*
2+
XPECT_SETUP org.omg.kerml.xpect.tests.parsing.KerMLParsingTest
3+
ResourceSet {
4+
ThisFile {}
5+
File {from ="/library/Base.kerml"}
6+
File {from ="/library/Occurrences.kerml"}
7+
File {from ="/library/Objects.kerml"}
8+
}
9+
Workspace {
10+
JavaProject {
11+
SrcFolder {
12+
ThisFile {}
13+
File {from ="/library/Base.kerml"}
14+
File {from ="/library/Occurrences.kerml"}
15+
File {from ="/library/Objects.kerml"}
16+
}
17+
}
18+
}
19+
END_SETUP
20+
*/
21+
package Subsetting_constant_invalid {
22+
23+
class A {
24+
const feature f;
25+
// XPECT errors--->"Subsetting/redefining feature must be constant if subsetted/redefined feature is constant" at "f"
26+
var feature g :> f;
27+
}
28+
29+
class B :> A {
30+
// XPECT errors--->"Subsetting/redefining feature must be constant if subsetted/redefined feature is constant" at "f"
31+
var feature h :>> f;
32+
var feature i :> g;
33+
}
34+
35+
}

0 commit comments

Comments
 (0)