mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
fix(tests): update apply_patch bins and snapshots
This commit is contained in:
@@ -16,8 +16,7 @@ fn test_apply_patch_cli_add_and_update() -> anyhow::Result<()> {
|
||||
+hello
|
||||
*** End Patch"#
|
||||
);
|
||||
Command::cargo_bin("apply_patch")
|
||||
.expect("should find apply_patch binary")
|
||||
Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"))
|
||||
.arg(add_patch)
|
||||
.current_dir(tmp.path())
|
||||
.assert()
|
||||
@@ -34,8 +33,7 @@ fn test_apply_patch_cli_add_and_update() -> anyhow::Result<()> {
|
||||
+world
|
||||
*** End Patch"#
|
||||
);
|
||||
Command::cargo_bin("apply_patch")
|
||||
.expect("should find apply_patch binary")
|
||||
Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"))
|
||||
.arg(update_patch)
|
||||
.current_dir(tmp.path())
|
||||
.assert()
|
||||
@@ -59,8 +57,7 @@ fn test_apply_patch_cli_stdin_add_and_update() -> anyhow::Result<()> {
|
||||
+hello
|
||||
*** End Patch"#
|
||||
);
|
||||
let mut cmd =
|
||||
assert_cmd::Command::cargo_bin("apply_patch").expect("should find apply_patch binary");
|
||||
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"));
|
||||
cmd.current_dir(tmp.path());
|
||||
cmd.write_stdin(add_patch)
|
||||
.assert()
|
||||
@@ -77,8 +74,7 @@ fn test_apply_patch_cli_stdin_add_and_update() -> anyhow::Result<()> {
|
||||
+world
|
||||
*** End Patch"#
|
||||
);
|
||||
let mut cmd =
|
||||
assert_cmd::Command::cargo_bin("apply_patch").expect("should find apply_patch binary");
|
||||
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"));
|
||||
cmd.current_dir(tmp.path());
|
||||
cmd.write_stdin(update_patch)
|
||||
.assert()
|
||||
|
||||
@@ -36,7 +36,7 @@ fn run_apply_patch_scenario(dir: &Path) -> anyhow::Result<()> {
|
||||
// Run apply_patch in the temporary directory. We intentionally do not assert
|
||||
// on the exit status here; the scenarios are specified purely in terms of
|
||||
// final filesystem state, which we compare below.
|
||||
Command::cargo_bin("apply_patch")?
|
||||
Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"))
|
||||
.arg(patch)
|
||||
.current_dir(tmp.path())
|
||||
.output()?;
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
use assert_cmd::Command;
|
||||
use assert_cmd::prelude::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use tempfile::tempdir;
|
||||
|
||||
fn run_apply_patch_in_dir(dir: &Path, patch: &str) -> anyhow::Result<assert_cmd::assert::Assert> {
|
||||
let mut cmd = Command::cargo_bin("apply_patch")?;
|
||||
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"));
|
||||
cmd.current_dir(dir);
|
||||
Ok(cmd.arg(patch).assert())
|
||||
}
|
||||
|
||||
fn apply_patch_command(dir: &Path) -> anyhow::Result<Command> {
|
||||
let mut cmd = Command::cargo_bin("apply_patch")?;
|
||||
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("apply_patch"));
|
||||
cmd.current_dir(dir);
|
||||
Ok(cmd)
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: tui/tests/vt100_chatwidget_snapshot.rs
|
||||
expression: output
|
||||
---
|
||||
+----------------------------------------------------------------------------+
|
||||
+----------------------------- ✶ Browsing... -----------------------------+
|
||||
| Every Code |
|
||||
+----------------------------------------------------------------------------+
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: tui/tests/vt100_chatwidget_snapshot.rs
|
||||
expression: output
|
||||
---
|
||||
+----------------------------------------------------------------------------+
|
||||
+----------------------------- ✶ Browsing... -----------------------------+
|
||||
| Every Code |
|
||||
+----------------------------------------------------------------------------+
|
||||
• Hello! How can I help you today?
|
||||
|
||||
+3
-3
@@ -8,10 +8,10 @@ expression: output
|
||||
- Running commands
|
||||
|
||||
|
||||
» Command guard: Leading cd /tmp/work is redundant
|
||||
|
||||
› Keep browsing while checking status
|
||||
|
||||
» Command guard: Leading cd /tmp/work is redundant
|
||||
|
||||
+- Browser (headless): example.com
|
||||
|
|
||||
| Actions
|
||||
@@ -21,7 +21,7 @@ expression: output
|
||||
|
|
||||
+- [Ctrl+B] View · [Esc] Stop
|
||||
|
||||
+----------------------------------------------------------------------------+
|
||||
+----------------------------- ✶ Browsing... -----------------------------+
|
||||
| What can I code for you today? |
|
||||
+----------------------------------------------------------------------------+
|
||||
Read Only (Shift+Tab change) Ctrl+G guide • API key
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
source: tui/tests/vt100_chatwidget_snapshot.rs
|
||||
expression: output
|
||||
---
|
||||
+----------------------------------------------------------------------------+
|
||||
+----------------------------- ✶ Agents... -----------------------------+
|
||||
| Every Code |
|
||||
+----------------------------------------------------------------------------+
|
||||
› Can you gather details from the latest docs update?
|
||||
|
||||
Reference in New Issue
Block a user