| Ticket UUID: | 3ae1251264a95d5c600bdd79e41d62e261d7af31 | |||
| Title: | string-29.6 fails due to interp alias | |||
| Type: | Bug | Version: | 45c4e5f731439886aa1770443dfcb9b810780e06a5c9ddd6a6ea6e49b5b8aa35 | |
| Submitter: | andy | Created on: | 2017-09-20 18:03:12 | |
| Subsystem: | 47. Bytecode Compiler | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Open | Last Modified: | 2017-09-21 14:35:43 | |
| Resolution: | None | Closed By: | nobody | |
| Closed on: | ||||
| Description: |
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/] | |||
| User Comments: |
dgp added on 2017-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. dgp added on 2017-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. | |||