summaryrefslogtreecommitdiff
path: root/tests/send.test
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-04 17:21:04 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-04 17:21:04 -0800
commite0b431a48cc3ac5d3ec32f06eddd9708ad655fa2 (patch)
treece4c73521220fbb751c2be6a42e85ff6a6cbff97 /tests/send.test
downloadexpect-e0b431a48cc3ac5d3ec32f06eddd9708ad655fa2.tar.gz
expect-e0b431a48cc3ac5d3ec32f06eddd9708ad655fa2.tar.bz2
expect-e0b431a48cc3ac5d3ec32f06eddd9708ad655fa2.zip
Imported Upstream version 5.45upstream/5.45
Diffstat (limited to 'tests/send.test')
-rw-r--r--tests/send.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/send.test b/tests/send.test
new file mode 100644
index 0000000..f43a294
--- /dev/null
+++ b/tests/send.test
@@ -0,0 +1,39 @@
+# Commands covered: send
+#
+# This file contains a collection of tests for one or more of the Tcl
+# built-in commands. Sourcing this file into Tcl runs the tests and
+# generates output for errors. No output means no errors were found.
+
+if {[lsearch [namespace children] ::tcltest] == -1} {
+ package require tcltest
+ # do this in a way that is backward compatible for Tcl 8.3
+ namespace import ::tcltest::test ::tcltest::cleanupTests
+}
+package require Expect
+
+log_user 0
+
+#exp_internal -f /dev/ttyp5 0
+
+test send-1.1 {basic send operation} {
+ spawn cat
+ after 1000
+ send "foo\r"
+ expect foo
+ after 1000
+ send "\u0004"
+ expect eof
+ regexp "\r\nfoo\r\n" $expect_out(buffer)
+} {1}
+
+test send-1.2 {send null} {
+ spawn od -c
+ send "a\u0000b\r"
+ after 1000
+ send \u0004
+ expect eof
+ regexp "a \\\\0 b" $expect_out(buffer)
+} {1}
+
+cleanupTests
+return