Tcl Source Code

View Ticket
Login
Ticket UUID: fc87e3bddddf20e048d8e6870173ee48d22beee5
Title: get-3.4.1 fails when enabled
Type: Bug Created on: 2023-09-06 14:25:38
Submitter: dgp Assigned to: dgp
Subsystem: 11. Conversions from String Severity: Minor
Priority: 5 Medium Last modified: 2023-09-06 18:41:50
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2023-09-06 18:41:50
Version: 8.7
Description:
$ make test-tcl TESTFLAGS='-singleproc 1 -file "chanio.test get.test" -match get-3.4.1'
...
chanio.test
get.test


==== get-3.4.1 Tcl_GetDouble with iffy numbers FAILED
==== Contents of test case:

    lmap x {"09"} {
        catch {testdoubleobj set 1 $x} x
        set x
    }

---- Result was:
{expected floating-point number but got "09" (looks like invalid octal number)}
---- Result should have been (exact matching):
9.0
==== get-3.4.1 FAILED


Without -singleproc 1 there is no failure, but the test is skipped due
to the "deprecated" constraint.

It's not clear to me that the test is correct for 8.7 as well.
User Comments:
dgp added on 2023-09-06 18:19:43:
There is a support script in the test suite named tcltests.tcl that
some of the test files [source] to bring in common foundations.

The test file chanio.test does.  The test file get.test does not.

One common item provided is the "deprecated" constraint.  In this
example the -singleproc changes things because it changes whether the
test runs in an interp where the "deprecated" constraint is defined 
and true.

Since get.test is using the "deprecated" constraint, seem like it
should also [source] the support script that provides it.

jan.nijtmans added on 2023-09-06 18:31:32:

Good catch! You're absolutely right: The error (actuall: 2 errors) are in the testcase, which was wrongly compied from 9.0.

1) The testcase doesn't source "tcltests.tcl", that's why the "deprecated" constraint didn't work

2) The expected test-output was wrong (it was the 9.0 expected output, not the 8.x one)

Fix [377c5b39c7da581a|here]


dgp added on 2023-09-06 18:35:31:
After making that correction, the test now reliably fails.

I'm thinking the logic of what the "deprecated" constraint means,
and whether the test should run and what result it should expect
needs a review.

dgp added on 2023-09-06 18:37:17:
Thanks for the confirmation.  I'll get the fork closed.