Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 40ea2b52665a0ac2538f3711b5e8d0332e333bd9
Ticket: 513983ffffffffffffffffffffffffffffffffff
invalid calls to [test] should throw errors
User & Date: kenstir on 2002-02-08 22:08:26
Changes

  1. icomment:
    Logged In: YES 
    user_id=246646
    
    Don, I like your patch better, because it doesn't duplicate 
    the error strings, and it has the bonus of printing out the 
    valid flags when you supply a bad one.  I don't know what 
    the original purpose was of printing the error to 
    [errorChannel], but I'm happy to avoid it.
    
    I'm also OK with your latest suggestion: record the number 
    of tests failing due to syntax errors.  I would be happy to 
    count these error conditions in the Failed column.  The 
    main issue for myself, and I suspect for the guy with the 
    11,293 tests, is that I don't want to accidentally miss 
    programming errors.  This is why I write tests in the first 
    place.
    
    I don't believe that leaving things as they are is a 
    reasonable alternative.  Let's say test 137 out of 11,293 
    fails due to a syntax error.  How would you notice?  
    Currently, the only record you have that anything went 
    wrong is some small bit of output in a potential sea of 
    output.  There are things that you could do to notice them, 
    such as wrapping tcltest::test in your own proc, or 
    wrapping puts, or creating a stacked errorChannel, but I 
    don't think any of them are as useful, or as easy, as 
    throwing an exception.
    
    My first preference is to take Don's patch as is.  This 
    patch treats programming errors as exceptions, which is 
    standard practice for tcl libraries.  For instance, the 
    scripts {array names} and {file} throw exceptions due to 
    usage errors.
    
    My second preference is to implement Don's suggestion of 
    recording the number of syntax errors.  This is less 
    attractive to me because it is a more invasive change.  
    Having a new element in the tcltest::numTests array would 
    be OK and straightforward, though it would have the 
    unfortunate side effect of making the summary output from 
    tcltest::cleanupTests harder to read; it probably would no 
    longer fit on one line.  Having syntax errors counted under 
    the Failed column would be better, though I fear it would 
    be more invasive to the existing control structure.
    
    
    
  2. login: "kenstir"
  3. mimetype: "text/plain"
  4. username: "kenstir"