File: Xsetup

package info (click to toggle)
tcllib 1.10-dfsg-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 17,708 kB
  • ctags: 6,122
  • sloc: tcl: 106,354; ansic: 9,205; sh: 8,707; xml: 1,766; yacc: 753; makefile: 115; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (58 lines) | stat: -rw-r--r-- 1,689 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- tcl -*-
# graph.testsuite.setup:  Setting up implementation specific definitions.
#
# Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
# All rights reserved.
#
# RCS: @(#) $Id: Xsetup,v 1.1 2006/11/16 06:33:13 andreas_kupries Exp $

# -------------------------------------------------------------------------

# tmWrong   - wrong#args generation, missing arguments
# tmTooMany - wrong#args generation, too many arguments
# MY        - variable holding the name of the graph instance found in
#             error messages.

# -------------------------------------------------------------------------

namespace import -force struct::graph

::tcltest::testConstraint graph_critcl [string equal $impl critcl]

switch -exact -- $impl {
    critcl {
	set MY mygraph

	proc tmWrong {m loarg n {xarg {}}} {
	    return [tcltest::wrongNumArgs "mygraph $m" $loarg $n]
	}

	proc tmTooMany {m loarg {xarg {}}} {
	    return [tcltest::tooManyArgs "mygraph $m" $loarg]
	}

	proc tmE {tcl critcl} {return $critcl}
    }
    tcl {
	set MY ::mygraph

	proc tmWrong {m loarg n {xarg {}}} {
	    if {$xarg == {}} {set xarg $loarg}
	    if {$xarg != {}} {set xarg " $xarg"}
	    if {[llength $m] > 1} {set m _[join $m _]}
	    incr n
	    return [tcltest::wrongNumArgs "::struct::graph::_$m" "name$xarg" $n]
	}

	proc tmTooMany {m loarg {xarg {}}} {
	    if {$xarg == {}} {set xarg $loarg}
	    if {$xarg != {}} {set xarg " $xarg"}
	    if {[llength $m] > 1} {set m _[join $m _]}
	    return [tcltest::tooManyArgs "::struct::graph::_$m" "name$xarg"]
	}

	proc tmE {tcl critcl} {return $tcl}
    }
}

# -------------------------------------------------------------------------