mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-04 05:28:02 +00:00
fake-editor: add dump command to be used with insta::assert_snapshot!()
This allows us to use insta against dumped content.
This commit is contained in:
parent
8613ec985c
commit
1cb1a1f1dc
1 changed files with 4 additions and 0 deletions
|
@ -46,6 +46,10 @@ fn main() {
|
|||
match parts.as_slice() {
|
||||
[""] => {}
|
||||
["fail"] => exit(1),
|
||||
["dump", dest] => {
|
||||
let dest_path = edit_script_path.parent().unwrap().join(dest);
|
||||
fs::copy(&args.file, dest_path).unwrap();
|
||||
}
|
||||
["expect"] => {
|
||||
let actual = String::from_utf8(fs::read(&args.file).unwrap()).unwrap();
|
||||
if actual != payload {
|
||||
|
|
Loading…
Reference in a new issue