diff options
author | 2014-10-11 13:29:36 -0700 | |
---|---|---|
committer | 2014-10-11 13:29:36 -0700 | |
commit | 969ef55e0c579e0538eff680f8bbf1b289777500 (patch) | |
tree | f3b25d35c7d302e1f7acff9d74f52788a0d5ec5c /Test/dafny0 | |
parent | 1ccf16ba273126bad1257289638f08315a218dc1 (diff) |
A few more sequence slice test cases.
Diffstat (limited to 'Test/dafny0')
-rw-r--r-- | Test/dafny0/SeqSlice.dfy | 13 | ||||
-rw-r--r-- | Test/dafny0/SeqSlice.dfy.expect | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Test/dafny0/SeqSlice.dfy b/Test/dafny0/SeqSlice.dfy index 2f9c4bbd..caf42a0d 100644 --- a/Test/dafny0/SeqSlice.dfy +++ b/Test/dafny0/SeqSlice.dfy @@ -48,3 +48,16 @@ function method middle<G>(s: seq<G>): G {
s[|s| / 2]
}
+
+method MoreTests<T>(s: seq<T>)
+ requires 10 <= |s|;
+{
+ var t := [3.14, 2.7, 1.41, 1985.44, 100.0, 37.2][1:0:3];
+ assert |t| == 3 && t[0] == [3.14] && t[1] == [] && t[2] == [2.7, 1.41, 1985.44];
+
+ var u := [true, false, false, true][1:1:];
+ assert |u| == 3 && u[0][0] && !u[1][0] && u[2] == [false, true];
+
+ assert s[10:][0] == s[..10];
+ assert s[10:][1] == s[10..];
+}
diff --git a/Test/dafny0/SeqSlice.dfy.expect b/Test/dafny0/SeqSlice.dfy.expect index 4ef2de53..42fd56a5 100644 --- a/Test/dafny0/SeqSlice.dfy.expect +++ b/Test/dafny0/SeqSlice.dfy.expect @@ -1,2 +1,2 @@ -Dafny program verifier finished with 6 verified, 0 errors
+Dafny program verifier finished with 8 verified, 0 errors
|