Skip to content

Commit 23eb10e

Browse files
committed
Add test for Ctrl+C behavior
1 parent cfaf34e commit 23eb10e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/IntegrationSpec.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ spec = do
9999
cs (stderr result) `shouldContain` "Building NixOS config...\nCommand exited with code 1"
100100
cs (stderr result) `shouldContain` "does not provide attribute 'packages.x86_64-linux.nixosConfigurations.\"does-not-exist\""
101101

102+
it "`vmcli start` doesn't mess up the terminal" $ \ctx -> do
103+
writeStandardFlake ctx Nothing
104+
Cradle.StdoutRaw before <- Cradle.run $ Cradle.cmd "stty" & Cradle.addArgs ["-a" :: Text]
105+
_ <- assertSuccess $ test ctx ["start", "server"]
106+
Cradle.StdoutRaw after <- Cradle.run $ Cradle.cmd "stty" & Cradle.addArgs ["-a" :: Text]
107+
after `shouldBe` before
108+
102109
it "starts vms with arbitrary hostnames" $ \ctx -> do
103110
writeStandardFlake ctx (Just "{ lib, ...} : { networking.hostName = lib.mkForce \"other-hostname\"; }")
104111
_ <- assertSuccess $ test ctx ["up", "server"]

0 commit comments

Comments
 (0)