fix: enable clippy on tests (#870)

https://github.com/openai/codex/pull/855 added the clippy warning to
disallow `unwrap()`, but apparently we were not verifying that tests
were "clippy clean" in CI, so I ended up with a lot of local errors in
VS Code.

This turns on the check in CI and fixes the offenders.
This commit is contained in:
Michael Bolin
2025-05-08 16:02:56 -07:00
committed by GitHub
parent 699ec5a87f
commit a9adb4175c
13 changed files with 31 additions and 11 deletions

View File

@@ -67,7 +67,10 @@ fn test_head_one_flag_one_file() -> Result<()> {
exec: ValidExec {
program: "head".to_string(),
flags: vec![],
opts: vec![MatchedOpt::new("-n", "100", ArgType::PositiveInteger).unwrap()],
opts: vec![
MatchedOpt::new("-n", "100", ArgType::PositiveInteger)
.expect("should validate")
],
args: vec![MatchedArg::new(
2,
ArgType::ReadableFile,

View File

@@ -47,7 +47,10 @@ fn test_sed_print_specific_lines_with_e_flag() -> Result<()> {
exec: ValidExec {
program: "sed".to_string(),
flags: vec![MatchedFlag::new("-n")],
opts: vec![MatchedOpt::new("-e", "122,202p", ArgType::SedCommand).unwrap()],
opts: vec![
MatchedOpt::new("-e", "122,202p", ArgType::SedCommand)
.expect("should validate")
],
args: vec![MatchedArg::new(3, ArgType::ReadableFile, "hello.txt")?],
system_path: vec!["/usr/bin/sed".to_string()],
}