-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tests that disable redaction into a separate crate
This is neccessary because rust runs all tests in the same process, leading to tests failing randomly, because of other tests modifying the global state. There is some proposal on the rust compiler-team github repo but until that gets stabilized we have to use this hack instead rust-lang/compiler-team#508
- Loading branch information
Showing
5 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "disable-redaction-test" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
veil = { path = "../../" } | ||
veil-tests = { path = "../" } |
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,12 @@ | ||
#![cfg_attr(not(test), allow(unused))] | ||
/// Simple test that ensures veil can actually be disabled | ||
use veil::Redact; | ||
use veil_tests::{SENSITIVE_DATA, assert_has_sensitive_data}; | ||
#[test] | ||
fn test_veil_can_be_disabled() { | ||
#[derive(Redact)] | ||
struct SensitiveWrapper(#[redact] String); | ||
veil::set_debug_format(veil::DebugFormat::Plaintext).ok(); | ||
assert_has_sensitive_data(SensitiveWrapper(SENSITIVE_DATA[0].to_string())); | ||
} |
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