summaryrefslogtreecommitdiff
path: root/Test/dafny0/SmallTests.dfy
diff options
context:
space:
mode:
authorGravatar wuestholz <unknown>2011-12-21 17:49:31 +0100
committerGravatar wuestholz <unknown>2011-12-21 17:49:31 +0100
commit9152bf2ff98b1dce60a347afa4ec39bc3df86c4a (patch)
tree0a1eab252e247e4c2768634bfccdeaa9124639ca /Test/dafny0/SmallTests.dfy
parent4e73a3397844fa7802854fd059a32b0c33c46de7 (diff)
Dafny: Added support for attributes on method/constructor calls.
Diffstat (limited to 'Test/dafny0/SmallTests.dfy')
-rw-r--r--Test/dafny0/SmallTests.dfy40
1 files changed, 40 insertions, 0 deletions
diff --git a/Test/dafny0/SmallTests.dfy b/Test/dafny0/SmallTests.dfy
index 7adc26a3..e6590ed1 100644
--- a/Test/dafny0/SmallTests.dfy
+++ b/Test/dafny0/SmallTests.dfy
@@ -418,6 +418,26 @@ function F(b: bool): int
class AttributeTests {
var f: int;
+ method m0()
+ {
+
+ }
+
+ method m1() returns (r: bool)
+ {
+ r := false;
+ }
+
+ function method m2() : bool
+ {
+ true
+ }
+
+ constructor C()
+ {
+
+ }
+
method testAttributes0()
ensures {:boolAttr true} true;
ensures {:boolAttr false} true;
@@ -465,5 +485,25 @@ class AttributeTests {
{
}
+
+ m0() {:boolAttr true};
+ m0() {:boolAttr false};
+ m0() {:intAttr 0};
+ m0() {:intAttr 1};
+
+ var b1 := m1() {:boolAttr true};
+ b1 := m1() {:boolAttr false};
+ b1 := m1() {:intAttr 0};
+ b1 := m1() {:intAttr 1};
+
+ var b2 := m2() {:boolAttr true};
+ b2 := m2() {:boolAttr false};
+ b2 := m2() {:intAttr 0};
+ b2 := m2() {:intAttr 1};
+
+ var c := new AttributeTests.C() {:boolAttr true};
+ c := new AttributeTests.C() {:boolAttr false};
+ c := new AttributeTests.C() {:intAttr 0};
+ c := new AttributeTests.C() {:intAttr 1};
}
}