debuggers: import openocd-0.7.0
Initial check-in of openocd-0.7.0 as it can be downloaded from http://sourceforge.net/projects/openocd/files/openocd/0.7.0/ Any modifications will follow. Change-Id: I6949beaefd589e046395ea0cb80f4e1ab1654d55
This commit is contained in:
32
debuggers/openocd/jimtcl/tests/lsortcmd.test
Normal file
32
debuggers/openocd/jimtcl/tests/lsortcmd.test
Normal file
@ -0,0 +1,32 @@
|
||||
source [file dirname [info script]]/testing.tcl
|
||||
|
||||
set list {b d a c z}
|
||||
|
||||
proc sorter {a v1 v2} {
|
||||
set ::arg $a
|
||||
return [string compare $v1 $v2]
|
||||
}
|
||||
|
||||
proc test_lsort_cmd {test cmd list exp} {
|
||||
lsort -command $cmd $list
|
||||
if {$::arg != $exp} {
|
||||
error "$test: Failed"
|
||||
}
|
||||
}
|
||||
|
||||
test lsortcmd-1.1 "Sort with one arg" {
|
||||
lsort -command "sorter arg1" $list
|
||||
set arg
|
||||
} {arg1}
|
||||
|
||||
test lsortcmd-1.2 "Sort with one arg containg spaces" {
|
||||
lsort -command {sorter "arg with space"} $list
|
||||
set arg
|
||||
} {arg with space}
|
||||
|
||||
test lsortcmd-1.3 "Sort with arg as list containg spaces" {
|
||||
lsort -command [list sorter [list arg with list "last with spaces"]] $list
|
||||
set arg
|
||||
} {arg with list {last with spaces}}
|
||||
|
||||
testreport
|
||||
Reference in New Issue
Block a user