Artifact 38609f2a5a51c71b3b910f0f90bd9f5592bdd873:
- File tests/winConsole.test — part of check-in [cbfb8313ba] at 2003-11-14 20:44:43 on branch trunk — * doc/ParseCmd.3: Implementation of TIP 157. Adds recognition * doc/Tcl.n: of the new leading {expand} syntax on words. * generic/tcl.h: Parses such words as the new Tcl_Token type * generic/tclBasic.c: TCL_TOKEN_EXPAND_WORD. Updated Tcl_EvalEx * generic/tclCompile.c: and the bytecode compiler/execution engine * generic/tclCompile.h: to recognize the new token type. New opcodes * generic/tclExecute.c: INST_LIST_VERIFY and INST_INVOKE_EXP and a new * generic/tclParse.c: operand type OPERAND_ULIST1 are defined. Docs * generic/tclTest.c: and tests are included. * tests/basic.test: * tests/compile.test: * tests/parse.test: * library/auto.tcl: Replaced several [eval]s used to perform * library/package.tcl: argument expansion with the new syntax. * library/safe.tcl: In the test files lindex.test and lset.test, * tests/cmdInfo.test: replaced use of [eval] to force direct * tests/encoding.test: string evaluation with use of [testevalex] * tests/execute.test: which more directly and robustly serves the * tests/fCmd.test: same purpose. * tests/http.test: * tests/init.test: * tests/interp.test: * tests/io.test: * tests/ioUtil.test: * tests/iogt.test: * tests/lindex.test: * tests/lset.test: * tests/namespace-old.test: * tests/namespace.test: * tests/pkg.test: * tests/pkgMkIndex.test: * tests/proc.test: * tests/reg.test: * tests/trace.test: * tests/upvar.test: * tests/winConsole.test: * tests/winFCmd.test: (user: dgp, size: 1226) [annotate] [blame] [check-ins using]
# This file tests the tclWinConsole.c file. # # 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. # # Copyright (c) 1999 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: winConsole.test,v 1.6 2003/11/14 20:44:47 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest namespace import -force ::tcltest::* } test winConsole-1.1 {Console file channel: non-blocking gets} \ {pcOnly interactive} { set oldmode [fconfigure stdin] puts stdout "Enter abcdef<return> now: " nonewline flush stdout fileevent stdin readable { if {[gets stdin line] >= 0} { set result $line } else { set result "gets failed" } } fconfigure stdin -blocking 0 -buffering line set result {} vwait result #cleanup the fileevent fileevent stdin readable {} fconfigure stdin {expand}$oldmode set result } "abcdef" #cleanup ::tcltest::cleanupTests return