Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2017-09-21
14:35
[3ae1251264] Run only the tests that match the assumptions of the test design. check-in: 42d9139712 user: dgp tags: amg-string-insert
14:35 • Ticket [3ae1251264] string-29.6 fails due to interp alias status still Open... artifact: 5e42f7e2d3 user: dgp
13:54 • Ticket [3ae1251264]: 2 changes artifact: 813d933e20 user: dgp
13:36 • Ticket [3ae1251264]: 3 changes artifact: 82536d0766 user: dgp
2017-09-20
18:03 • New ticket [3ae1251264]. artifact: c684bfc3b2 user: andy

string-29.6 fails due to interp alias

Open3ae1251264a95d5c600bdd79e41d62e261d7af31Created 9 years agoUpdated 9 years ago
Descriptionplain2017-09-20 18:03:12
Check-in [45c4e5f731] on the amg-string-insert branch altered the way string.test is executed so that both bytecoded and non-bytecoded implementations would be tested.  The design approach was lifted from basic.test, namely to run all commands under test using a new [run] command which is [interp alias]'ed to [if 1] or [testevalex].

This change causes test string-29.6 to fail.  The test in question calls [tcl::unsupported::representation] to confirm that a string representation is not needlessly being generated when using [string cat] to concatenate an empty list with a pure list.  When [string cat] is called directly, or when called as the argument to [if 1], it works correctly.  But when [string cat] is called by an interpreter alias to [if 1], the string representation is produced, causing the test to fail.

For more information, see [https://sourceforge.net/p/tcl/mailman/message/36046091/]
Referenced by1
  • 42d9139712[3ae1251264] Run only the tests that match the assumptions of the test design. check-in2017-09-21 14:35:53
dgpplain2017-09-21 13:36:50
The purpose of tests string-29.5 through string-29.15
is to test internal details of TclStringCatObjv() over
many cases of input conditions, what Tcl_ObjType's they
have and whether they have a string rep.

string-29.6 in particular wants the second argument to
come in without a string rep.  As originally implemented
it did that.

The revisions to drive things with an alias has upset
that design.  The second argument now comes in with a
string rep already generated, so the test no longer
tests what it intends to test, and fails.
dgp Ticket [3ae1251264]: 2 changes [History diff]2017-09-21 13:54:04
dgpplain2017-09-21 14:35:43
The purpose is to test TclStringCatObjv and [string cat]
is just a mechanism to get there.

The direct eval path via StringCatCmd() is very simple and
lets us pass through directly the arguments carefully
constructed to cover the cases.

The path through bytecode is much messier with several layers
of optimization and literal management.  I honestly do not
understand why some of the tests have been passing.  I
cannot devote the time now to digging out all the detail.

The simple fix, or workaround if you insist, is to run 
only those tests that match the intent.  I've committed
that change to the amg-string-insert branch.
Log in (anonymous is fine) to add a comment.