about summary refs log tree commit diff
path: root/tvix/Cargo.nix
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.nix
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.nix')
-rw-r--r--tvix/Cargo.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index bf0958407907..3d3841734178 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -2966,6 +2966,16 @@ rec {
         ];
 
       };
+      "dissimilar" = rec {
+        crateName = "dissimilar";
+        version = "1.0.9";
+        edition = "2018";
+        sha256 = "0bcn4s99ghigd3yadpd7i3gljv5z2hkr07ijvvxvsxmz3yfygy2r";
+        authors = [
+          "David Tolnay <dtolnay@gmail.com>"
+        ];
+
+      };
       "doc-comment" = rec {
         crateName = "doc-comment";
         version = "0.3.3";
@@ -3414,6 +3424,26 @@ rec {
         };
         resolvedDefaultFeatures = [ "std" ];
       };
+      "expect-test" = rec {
+        crateName = "expect-test";
+        version = "1.5.0";
+        edition = "2018";
+        sha256 = "1q55nrkgzg345905aqbsdrwlq4sk0gjn4z5bdph1an1kc6jy02wy";
+        authors = [
+          "rust-analyzer developers"
+        ];
+        dependencies = [
+          {
+            name = "dissimilar";
+            packageId = "dissimilar";
+          }
+          {
+            name = "once_cell";
+            packageId = "once_cell";
+          }
+        ];
+
+      };
       "fastcdc" = rec {
         crateName = "fastcdc";
         version = "3.1.0";
@@ -13908,6 +13938,12 @@ rec {
             packageId = "wu-manber";
           }
         ];
+        devDependencies = [
+          {
+            name = "expect-test";
+            packageId = "expect-test";
+          }
+        ];
         features = {
           "tracy" = [ "tvix-tracing/tracy" ];
         };