Skip to content

Commit

Permalink
Fix comments in all test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws committed Jun 17, 2024
1 parent 3a73c07 commit 82a194b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Check that Kani can automatically derive `Invariant` for structs with named fields.
//! Check that the `kani::invariant` attribute is applied and the associated
//! invariant can be checked through an `is_safe` call.
extern crate kani;
use kani::Invariant;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Check that Kani can automatically derive `Invariant` for structs with named fields.
//! Check that there is a compilation error when the predicate passed to
//! `kani::invariant` attribute would result in a compiler error.
extern crate kani;
use kani::Invariant;

// Note: The `x.is_safe() && y.is_safe()` requires `self` before each struct
// field to be evaluated in the `is_safe` function body.
#[derive(kani::Arbitrary)]
#[kani::invariant(x.is_safe() && y.is_safe())]
struct Point {
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/attr-invariant/no-struct-error/no-struct-error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Check that Kani can automatically derive `Invariant` for structs with named fields.
//! Check that Kani raises an error when the `kani::invariant` attribute is
//! applied to items which is not a struct.
extern crate kani;
use kani::Invariant;
Expand Down

0 comments on commit 82a194b

Please sign in to comment.