Overview
| Artifact ID: | 807dc5cfff258d3b4288a7afd0575e5e9ad24df76af0270fdce01fc12b2811de |
|---|---|
| Ticket: | 3cff6841c6b8b7af6f3d15dec74b626f557024ab
Small bug regarding -body/-returnCodes |
| User & Date: | arjenmarkus on 2018-01-02 09:21:28 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I am trying to use the -returnCodes option to test that a command is returning proper error codes if it is invoked with incorrect arguments. However, if I use -returnCodes, I cannot use -body to indicate the script. Here is a small script that illustrates the issue: # chktest.tcl -- # Check a strange phenomenon with tcltest # set version [package require tcltest] puts "Version tcltest: $version" namespace import ::tcltest::* test returncode-1.0 "Return an error code" { return -code 1 "Error" } -returnCodes 1 test returncode-1.1 "Return an error code" -body { return -code 1 "Error" } -returnCodes 1 The first test will succeed, whereas the second does not: Version tcltest: 2.4.0 ==== returncode-1.1 Return an error code FAILED ==== Contents of test case: return -code 1 "Error" ---- Test generated return exception; Return code was: 2 ---- Return code should have been one of: 1 ==== returncode-1.1 FAILED - foundin changed to: "2.4.0"
- is_private changed to: "0"
- login: "arjenmarkus"
- priority changed to: "5 Medium"
- private_contact changed to: "b4dd46eb62d921721c0aeef91d8d6e06aaeb6646"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "arjenmarkus"
- subsystem changed to: "34. tcltest Package"
- title changed to: "Small bug regarding -body/-returnCodes"
- type changed to: "Bug"