-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #781 from viperproject/meilers_update_tests
Adding and updating tests for recently fixed issues
- Loading branch information
Showing
3 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Any copyright is dedicated to the Public Domain. | ||
// http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
//:: IgnoreFile(/carbon/issue/428/) | ||
|
||
field f: Int | ||
|
||
method m(xs: Set[Ref], ys: Set[Ref]) | ||
{ | ||
inhale forall r: Ref :: r in xs ==> acc(r.f, r in ys ? 1/2 : none) | ||
|
||
package true --* true { | ||
assert forall r: Ref :: r in xs ==> acc(r.f, r in ys ? 1/2 : none) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Any copyright is dedicated to the Public Domain. | ||
// http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
|
||
method keydict___init__() returns (self: Ref) | ||
ensures forall key: Ref :: {keydict___item__(self, key)} acc(keydict___item__(self, key).keydict_val) && !keydict___contains__(self, key) | ||
|
||
function keydict___item__(self: Ref, key: Ref): Ref | ||
ensures keydict___item__inv(self, result) == key | ||
|
||
function keydict___item__inv(self: Ref, val_ref: Ref): Ref | ||
|
||
field keydict_val: Option[Ref] | ||
|
||
|
||
function keydict___contains__(self: Ref, key: Ref) : Bool | ||
requires acc(keydict___item__(self, key).keydict_val, wildcard) | ||
ensures result == keydict___item__(self, key).keydict_val.isSome | ||
|
||
|
||
|
||
adt Option[T] { | ||
Some(value:T) | ||
None() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters