-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use
assert_var_not_found()
instead of !manager.exists()
, to…
… also verify error contents
- Loading branch information
Showing
6 changed files
with
24 additions
and
19 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
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
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
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
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 |
---|---|---|
|
@@ -35,6 +35,7 @@ mod enumerator; | |
mod error; | ||
mod reader; | ||
mod sys; | ||
pub mod test_utils; | ||
pub mod utils; | ||
mod writer; | ||
|
||
|
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,10 @@ | ||
use crate::{efi::Variable, Error, VarReader}; | ||
|
||
/// asserts that the variable doesn't exist. Also validates the error | ||
pub fn assert_var_not_found(manager: &mut dyn VarReader, var: &Variable) { | ||
if let Error::VarNotFound { var: error_var } = manager.read(var).unwrap_err() { | ||
assert_eq!(&error_var, var); | ||
} else { | ||
panic!("Reading a non-existent variable should raise VarNotFound"); | ||
} | ||
} |