Skip to content

Commit 6fdb6f6

Browse files
senamakelmedullabot
andcommitted
test: keep account helper script outside function lint budget
Co-authored-by: Medulla <medulla@tinyhumans.ai>
1 parent fe2be6f commit 6fdb6f6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎crates/tinysecurity-audit/src/sink_windows_negative_tests.rs‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ fn windows_second_ordinary_account_cannot_read_or_replace_the_namespace()
254254
"-NoProfile",
255255
"-NonInteractive",
256256
"-Command",
257-
ordinary_account_script(),
257+
ORDINARY_ACCOUNT_SCRIPT,
258258
])
259259
.env("TINYSECURITY_TEST_DIRECTORY", root.path())
260260
.env("TINYSECURITY_TEST_OWNER", identity()?)
@@ -288,8 +288,7 @@ fn windows_second_ordinary_account_cannot_read_or_replace_the_namespace()
288288
Ok(())
289289
}
290290

291-
fn ordinary_account_script() -> &'static str {
292-
r"
291+
const ORDINARY_ACCOUNT_SCRIPT: &str = r"
293292
$ErrorActionPreference = 'Stop'
294293
$account = 'tsa' + [Guid]::NewGuid().ToString('N').Substring(0, 16)
295294
$password = ConvertTo-SecureString ('Tsa!A1' + [Guid]::NewGuid().ToString('N')) -AsPlainText -Force
@@ -389,8 +388,7 @@ exit 0
389388
exit 1
390389
}
391390
}
392-
"
393-
}
391+
";
394392

395393
#[test]
396394
fn windows_empty_or_null_directory_dacl_is_denied_before_candidate_commit()

0 commit comments

Comments
 (0)