Posted to tcl by tomk at Fri Apr 20 22:22:46 GMT 2018view pretty

Here is an example of two tests:

1.0 {
{"proc \{ args \} \{ puts hello"}
{error {unbalanced bracket}}
}
1.1 {
{puts "hello" "good"bye\"}
{error {extra character after close quote}}
}

These are written as:

test TEST-1.0 {ERRORS} -constraints {} -setup {
set txt "proc \{ args \} \{ puts hello"
} -body {
ScanInput::Text2Commands $txt C:/Users/tom/PROJECTS/src/kterm/ScanInput/TESTS/DEBUG/dbug_1.0.txt
} -result {error {unbalanced bracket}} -output {} -match exact -cleanup {}

test TEST-1.1 {ERRORS} -constraints {} -setup {
set txt {puts "hello" "good"bye\"}
} -body {
ScanInput::Text2Commands $txt C:/Users/tom/PROJECTS/src/kterm/ScanInput/TESTS/DEBUG/dbug_1.1.txt
} -result {error {extra character after close quote}} -output {} -match exact -cleanup {}