Skip to content

Commit

Permalink
add assertions to the test case for #89
Browse files Browse the repository at this point in the history
  • Loading branch information
mantkiew committed Jan 11, 2017
1 parent b390342 commit 59651b2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/failing/gi89-ref-to-constant.cfr
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
abstract ASIL -> integer
abstract ASIL ->> integer
A : ASIL -> 1
B : ASIL -> 2
C : ASIL -> 3
D : ASIL -> 4

assert [ A.dref = 1 ]
assert [ B.dref = 2 ]
assert [ C.dref = 3 ]
assert [ D.dref = 4 ]
19 changes: 19 additions & 0 deletions test/failing/gi89-ref-to-constant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
scope({c0_ASIL:4});
defaultScope(1);
intRange(-8, 7);
stringLength(16);

c0_ASIL = Abstract("c0_ASIL");
c0_A = Clafer("c0_A").withCard(1, 1);
c0_B = Clafer("c0_B").withCard(1, 1);
c0_C = Clafer("c0_C").withCard(1, 1);
c0_D = Clafer("c0_D").withCard(1, 1);
c0_ASIL.refTo(Int);
c0_A.extending(c0_ASIL).refToUnique(Int);
c0_B.extending(c0_ASIL).refToUnique(Int);
c0_C.extending(c0_ASIL).refToUnique(Int);
c0_D.extending(c0_ASIL).refToUnique(Int);
assert(equal(joinRef(global(c0_A)), constant(1)));
assert(equal(joinRef(global(c0_B)), constant(2)));
assert(equal(joinRef(global(c0_C)), constant(3)));
assert(equal(joinRef(global(c0_D)), constant(4)));

0 comments on commit 59651b2

Please sign in to comment.