1 { nano, expect, runCommand, writeScriptBin }:
3 let expect-script = writeScriptBin "expect-script" ''
4 #!${expect}/bin/expect -f
8 expect "GNU nano ${nano.version}"
10 # Add some text to the buffer
16 expect "Save modified buffer?"
20 expect "File Name to Write"
22 # Send "return" to accept the file path.
27 runCommand "nano-test-expect"
29 nativeBuildInputs = [ nano expect ];
30 passthru = { inherit expect-script; };
32 expect -f ${expect-script}/bin/expect-script
33 grep "Hello world!" file.txt