[tests] Move era_dump tests to Rust

This commit is contained in:
Ming-Hung Tsai
2021-10-05 15:22:23 +08:00
parent f6eb5173c9
commit cbc3baba45
3 changed files with 149 additions and 17 deletions

View File

@@ -66,21 +66,4 @@
(assert-starts-with
(string-append bad-xml ": No such file or directory")
stderr)))))
;;;-----------------------------------------------------------
;;; era_dump scenarios
;;;-----------------------------------------------------------
(define-scenario (era-dump small-input-file)
"Fails with small input file"
(with-temp-file-sized ((md "era.bin" 512))
(run-fail (era-dump md))))
(define-scenario (era-dump restore-is-noop)
"era_dump followed by era_restore is a noop."
(with-valid-metadata (md)
(run-ok-rcv (d1-stdout _) (era-dump md)
(with-temp-file-containing ((xml "era.xml" d1-stdout))
(run-ok (era-restore "-i" xml "-o" md))
(run-ok-rcv (d2-stdout _) (era-dump md)
(assert-equal d1-stdout d2-stdout))))))
)