summaryrefslogtreecommitdiffstats
path: root/tests/process.test
blob: fb3a5e2d0256f7a49086b9575298c8e98a151385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# process.test --
#
# This file contains a collection of tests for the tcl::process ensemble.
# Sourcing this file into Tcl runs the tests and generates output for
# errors.  No output means no errors were found.
#
# Copyright (c) 2017 Frederic Bonnet
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

test process-1.1 {tcl::process command basic syntax} -returnCodes error -body {
    tcl::process
} -result {wrong # args: should be "tcl::process subcommand ?arg ...?"}
test process-1.2 {tcl::process command basic syntax} -returnCodes error -body {
    tcl::process ?
} -match glob -result {unknown or ambiguous subcommand "?": must be autopurge, list, purge, or status}

test process-2.1 {tcl::process autopurge get} {tcl::process autopurge} {1}
test process-2.2 {tcl::process autopurge set true} {
    tcl::process autopurge true
    tcl::process autopurge
} {1}
test process-2.3 {tcl::process autopurge set false} {
    tcl::process autopurge false
    tcl::process autopurge
} {0}