원클릭으로
rust-unit-tests
Write, improve, and run Rust unit tests in the warp Rust codebase.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Write, improve, and run Rust unit tests in the warp Rust codebase.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Repo-specific review guidance for warp. Only the categories declared overridable by the core review-pr skill may be specialized here.
Repo-specific bug reproduction guidance for Warp. Specializes the core reproduce-bug-report skill for logged-out Warp UI repros, exact reporter-version installs, and login-free onboarding.
Promote a feature-flagged feature to Dogfood, Preview, or Stable in the Warp codebase. Use when a feature behind a FeatureFlag is ready to roll out to a broader audience, including wiring up the compile-time/runtime bridge and deferring flag cleanup safely.
Remove a feature flag after it has been rolled out and stabilized in the Warp codebase.
Launch two parallel Oz cloud agents with computer use to download and install the latest stable Linux Warp build, capture screenshots while walking through first-time onboarding in both logged-out and logged-in states, then selectively fan out follow-up cloud agents for distinct onboarding branches proposed by those initial explorers. Use this whenever the user asks to test, document, screenshot, or walk through the Warp first-time install/onboarding experience in a cloud Linux environment.
Create a one-time launch modal in the Warp client (feature announcement, onboarding, etc.). Use when adding a new modal that should appear exactly once per user on startup, gated by a feature flag, with colors sourced from Warp theme tokens and terminal theme colors.
| name | rust-unit-tests |
| description | Write, improve, and run Rust unit tests in the warp Rust codebase. |
${filename}_tests.rs or mod_test.rs.#[cfg(test)]
#[path = "filename_tests.rs"] // or "mod_test.rs"
mod tests;
fn parses_utf8_sequence_when_valid().assert_eq!/assert_ne! over assert! for clearer diffs.#[should_panic] only when panic semantics are intended API.model.lock() calls in the same call stack from tests.#[tokio::test] when the code requires a runtime.FeatureFlag::X.is_enabled()) over #[cfg(...)] so tests don’t require recompilation to toggle behavior.warpui::App::test for deterministic unit tests around views/models.update and assert via read.use warpui::App;
// In app crate tests prefer `crate::test_util::...`; from other crates use `warp::test_util::...`.
use warp::test_util::{terminal::initialize_app_for_terminal_view, add_window_with_terminal};
#[test]
fn example() {
App::test((), |mut app| async move {
// One-time app setup for terminal/view tests
initialize_app_for_terminal_view(&mut app); // includes settings init
let term = add_window_with_terminal(&mut app, None);
// Act
term.update(&mut app, |view, _ctx| {
view.model.lock().simulate_block("ls", "out");
});
// Assert
term.read(&app, |view, _ctx| {
assert!(view.model.lock().block_list().len() > 0);
});
})
}
TerminalModel::mock(..), .simulate_block(..), .finish_block(), .simulate_cmd(..).terminal::model::test_utils::{TestBlockListBuilder, TestBlockBuilder}.use virtual_fs::{VirtualFS, Stub};
VirtualFS::test("case", |_dirs, mut fs| {
fs.with_files(vec![Stub::FileWithContent("path/file.txt", "contents")]);
// run logic and assert
});
use warp::features::FeatureFlag; // or `use crate::features::FeatureFlag;` inside the app crate
let _flag = FeatureFlag::CreatingSharedSessions.override_enabled(true);
assert_lines_approx_eq!(actual_lines, INLINE_BANNER_HEIGHT);
model.lock() scopes minimal; avoid nested/re-entrant locks in the same call chain.initialize_settings_for_tests directly when using initialize_app_for_terminal_view (it already calls it).#[tokio::test] when a real runtime is required; otherwise prefer App::test.serial_test's #[serial] or local mocking instead of parallelism.cargo nextest run --no-fail-fast --workspace --exclude command-signatures-v2
cargo nextest run -p <crate_name>
cargo nextest run -E 'test(<substring>)'
cargo test --doc
Run before submitting changes:
./script/format
cargo clippy --workspace --all-targets --all-features --tests -- -D warnings
For a full local check before a PR, you can also run:
./script/presubmit