From 0ad986169d06922945d035aab8d82266e798bffc Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Sat, 6 Jul 2024 09:00:46 -0400 Subject: test(tvix/cli): Make the REPL testable Juggle around the internals of the tvix-cli crate so that we expose the Repl as a public type with a `send` method, that sends a string to the repl and *captures all output* so that it can be subsequently asserted on in tests. Then, demonstrate that this works with a single (for now) REPL test using expect-test to assert on the output of a single command sent to the REPL. As the REPL gets more complicated, this will allow us to make tests that cover that complex behavior. Change-Id: I88175bd72d8760c79faade95ebb1d956f08a7b83 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11958 Autosubmit: aspen Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/cli/Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tvix/cli/Cargo.toml') diff --git a/tvix/cli/Cargo.toml b/tvix/cli/Cargo.toml index f6d03ce5ab8f..abbb7e6c2bd0 100644 --- a/tvix/cli/Cargo.toml +++ b/tvix/cli/Cargo.toml @@ -30,6 +30,9 @@ tracing-indicatif = "0.3.6" [dependencies.wu-manber] git = "https://github.com/tvlfyi/wu-manber.git" +[dev-dependencies] +expect-test = "1.5.0" + [target.'cfg(not(target_env = "msvc"))'.dependencies] tikv-jemallocator = "0.5" -- cgit 1.4.1