File: pt_peg_from_json.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 (29 lines) | stat: -rw-r--r-- 1,027 bytes parent folder | download | duplicates (7)
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
# -*- tcl -*-
# General set of error cases regarding the number of arguments.

test pt-peg-from-json-1.0 {convert, wrong#args} -body {
    pt::peg::from::json convert
} -returnCodes error -result {wrong # args: should be "pt::peg::from::json convert text"}

test pt-peg-from-json-1.1 {convert, wrong#args} -body {
    pt::peg::from::json convert S XXX
} -returnCodes error -result {wrong # args: should be "pt::peg::from::json convert text"}

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

# Testing the processing of json input in various form.

foreach {k section} {
    0 -ultracompact
    1 -indented
    2 -indalign
} {
    TestFilesProcess $mytestdir ok peg_json$section peg_serial-canonical -> n label input data expected {
	test pt-peg-from-json-2.$k.$n "pt::peg::from::json, $label$section, ok :- $input" -body {
	    pt::peg::from::json convert $data
	} -result $expected
    }
}

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