Skip to content

Commit

Permalink
Added new test marking boundary/match issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinleroy committed Sep 2, 2023
1 parent c53852a commit 2eb69ac
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
27 changes: 27 additions & 0 deletions crates/aquascope/tests/boundaries/match_1.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
fn refit() {
let opt: Option<String> =
Some(String::from("Hello world"));

match opt {
Some(_) => (),
None => (),
};

drop(opt);
}

fn moveit() {
let opt: Option<String> =
Some(String::from("Hello world"));

match &opt {
// NOTE: this is an error, but Aquascope does not place
// RWO boundaries on patterns. This test serves to mark this
// inconsistency and it should be updated in the future
// (should that feature get implemented).
Some(mut s) => {
println!("{s}");
},
None => (),
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: crates/aquascope/tests/boundaries.rs
description: moveit@match_1.test
---
- location:
line: 16
column: 9
expected:
read: true
write: false
drop: false
actual:
type_droppable: true
type_writeable: false
type_copyable: false
is_live: true
path_uninitialized: false
permissions:
read: true
write: false
drop: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
source: crates/aquascope/tests/boundaries.rs
description: refit@match_1.test
---
- location:
line: 4
column: 11
expected:
read: true
write: false
drop: false
actual:
type_droppable: true
type_writeable: false
type_copyable: false
is_live: true
path_uninitialized: false
permissions:
read: true
write: false
drop: true
- location:
line: 9
column: 7
expected:
read: true
write: false
drop: true
actual:
type_droppable: true
type_writeable: false
type_copyable: false
is_live: true
path_uninitialized: false
permissions:
read: true
write: false
drop: true

0 comments on commit 2eb69ac

Please sign in to comment.