about summary refs log tree commit diff
path: root/tvix/Cargo.lock
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-07-06T13·00-0400
committerclbot <clbot@tvl.fyi>2024-07-07T14·19+0000
commit0ad986169d06922945d035aab8d82266e798bffc (patch)
tree683e4633d8fee9636aa14bf5c329281e0b3733a9 /tvix/Cargo.lock
parent3a79f937951d34c7293bb093e4c21ddc3c2d88fc (diff)
test(tvix/cli): Make the REPL testable r/8353
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 <root@gws.fyi>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/Cargo.lock')
-rw-r--r--tvix/Cargo.lock17
1 files changed, 17 insertions, 0 deletions
diff --git a/tvix/Cargo.lock b/tvix/Cargo.lock
index bbdeaeefb262..e3e5094d4584 100644
--- a/tvix/Cargo.lock
+++ b/tvix/Cargo.lock
@@ -977,6 +977,12 @@ dependencies = [
 ]
 
 [[package]]
+name = "dissimilar"
+version = "1.0.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d"
+
+[[package]]
 name = "doc-comment"
 version = "0.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1137,6 +1143,16 @@ dependencies = [
 ]
 
 [[package]]
+name = "expect-test"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e0be0a561335815e06dab7c62e50353134c796e7a6155402a64bcff66b6a5e0"
+dependencies = [
+ "dissimilar",
+ "once_cell",
+]
+
+[[package]]
 name = "fastcdc"
 version = "3.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4365,6 +4381,7 @@ dependencies = [
  "bytes",
  "clap",
  "dirs",
+ "expect-test",
  "nix-compat",
  "rnix",
  "rowan",