File: pt_tclparam_config_snit.tests

package info (click to toggle)
tcllib 2.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,560 kB
  • sloc: tcl: 306,798; ansic: 14,272; sh: 3,035; xml: 1,766; yacc: 1,157; pascal: 881; makefile: 124; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (52 lines) | stat: -rw-r--r-- 2,169 bytes parent folder | download | duplicates (6)
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
# -*- tcl -*-
# General set of error cases regarding the number of arguments.

test pt-tclparam-config-snit-1.0 {convert, wrong#args} -body {
    pt::tclparam::configuration::snit def
} -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"}

test pt-tclparam-config-snit-1.1 {convert, wrong#args} -body {
    pt::tclparam::configuration::snit def C
} -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"}

test pt-tclparam-config-snit-1.2 {convert, wrong#args} -body {
    pt::tclparam::configuration::snit def C P
} -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"}

test pt-tclparam-config-snit-1.3 {convert, wrong#args} -body {
    pt::tclparam::configuration::snit def C P V
} -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"}

test pt-tclparam-config-snit-2.0 {reset, wrong#args} -body {
    pt::tclparam::configuration::snit def C P V C XXX
} -returnCodes error -result {wrong # args: should be "pt::tclparam::configuration::snit def class pkg version cmd"}

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

# TODO :: Tests missing for: configure/cget, reset

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

# Testing the generation of tcl/param output configured for snit.

TestFilesProcess $mytestdir ok peg_serial-canonical peg_tclparam-snit -> n label input data expected {
    test pt-tclparam-config-snit-3.$n "pt::tclparam::configuration::snit, $label, ok :- $input" -setup {

	pt::peg::to::tclparam reset
	pt::peg::to::tclparam configure -name     TEMPLATE
	pt::peg::to::tclparam configure -file     TEST

	pt::tclparam::configuration::snit def \
	    PARSER SNIT_PACKAGE 1 \
	    {pt::peg::to::tclparam configure}

    } -body {
	pt::peg::to::tclparam convert $data
    } -cleanup {
	pt::peg::to::tclparam reset
    } -result $expected
}


#----------------------------------------------------------------------
unset n label input data expected