File: pt_cparam_config_tea.tests

package info (click to toggle)
tcllib 1.18-dfsg-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 64,304 kB
  • ctags: 28,857
  • sloc: tcl: 174,135; ansic: 14,215; sh: 2,643; xml: 1,766; yacc: 1,148; pascal: 583; makefile: 106; perl: 84; f90: 84; python: 33; ruby: 13; php: 11
file content (52 lines) | stat: -rw-r--r-- 2,092 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-cparam-config-tea-1.0 {convert, wrong#args} -body {
    pt::cparam::configuration::tea def
} -returnCodes error -result {wrong # args: should be "pt::cparam::configuration::tea def class pkg version cmd"}

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

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

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

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

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

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

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

# Testing the generation of c/param output configured for tea.

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

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

	pt::cparam::configuration::tea def \
	    PARSER PACKAGE 1 \
	    {pt::peg::to::cparam configure}

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


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