diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 10:53:36 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:39 +1000 |
commit | 6ef810ae664dccd457fe1ed750f7d509b6f60878 (patch) | |
tree | 13f3ab69416d1fc7f5d10db06c1bf83aa0153e4f /tests/stacktrace.test | |
parent | a0017cc44c22a83df8f92600317ad8ccd635e2a1 (diff) | |
download | jimtcl-6ef810ae664dccd457fe1ed750f7d509b6f60878.zip jimtcl-6ef810ae664dccd457fe1ed750f7d509b6f60878.tar.gz jimtcl-6ef810ae664dccd457fe1ed750f7d509b6f60878.tar.bz2 |
Bugs, features and tests
source fails with zero length file
unknown can't be called recursively
*: This can be useful when using unknown to dynamically load code,
which may in turn want to dynamically load code
*: Limit it to 50 recursions though
Allow string greater/less comparison
*: Comparing two strings for order did not work
Implement file join
*: It's not to hard and is handy when working with the current dir, ""
Don't omit [unknown] completely from stack trace
*: Since we lose valuable informtion, just omit the name
Fix return from case
Turn regexp patterns into real objects
*: Thus caching the compiled regexps
Allow error to rethrow an error
Replace bcopy() with more standard memcpy()
Fixes to parray, improve errorInfo
*: errorInfo takes an optional stack trace
Add tests for rethrowing errors via errorInfo
Fix ndelay
*: Was looking at wrong param
*: Also fix usage/help for aio.socket
Package should be able to call exit
*: Currently any return from a package is changed to JIM_ERR
Line counting is incorrect for backlash newline
Diffstat (limited to 'tests/stacktrace.test')
-rw-r--r-- | tests/stacktrace.test | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/stacktrace.test b/tests/stacktrace.test index f7d131c..328dd49 100644 --- a/tests/stacktrace.test +++ b/tests/stacktrace.test @@ -22,6 +22,47 @@ proc main {} { } $exp } } + proc unknown {args} { + error "from unknown" + } + + test err-10.1 "Stacktrace on error from unknown (badcmd, call)" { + set rc [catch {error_caller badcmd call} msg] + #puts stderr "err-10.1\n[errorInfo $msg]\n" + #puts stderr "\terr-10.1 {[list $rc $msg [info stacktrace]]}" + + list $rc $msg [info stacktrace] + } {1 {from unknown} {{} stacktrace.test 26 {} errors.tcl 6 error_generator errors.tcl 44 error_caller stacktrace.test 30}} + + rename unknown "" + + set a {one} + set b [list 1 \ + 2 \ + 3] + set c {two} + set d "list 1 + 2 + 3" + set e {three} + set f "list 1 \ + 2 \ + 3" + set g {four} + + test source-1.1 "Basic line numbers" { + info source $a + } {stacktrace.test 39} + + test source-1.2 "Line numbers after command with escaped newlines" { + info source $c + } {stacktrace.test 43} + test source-1.3 "Line numbers after string with newlines" { + info source $e + } {stacktrace.test 47} + test source-1.4 "Line numbers after string with escaped newlines" { + info source $g + } {stacktrace.test 51} } set expected { |