Tk Source Code

View Ticket
Login
Ticket UUID: 44e92d896eb31b8c6a6bca99f0a381bd4d4a1751
Title: reworked textDisp.test : font agnostic
Type: Patch Version: revised_text
Submitter: bll Created on: 2017-07-09 15:16:46
Subsystem: 18. [text] Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2022-06-11 21:34:34
Resolution: Fixed Closed By: fvogel
    Closed on: 2022-06-11 21:34:34
Description:
Attached find a new textDisp.test.

Many of the tests have been rebuilt to be font agnostic so that they will work on all platforms, and should also work with a different fixed width font.

Tests involving scroll positioning have not been rebuilt as yet.

The original textDisp.test has many values hard-coded.

In some cases the resulting hard-coded values were determined by using the return values from the test, resulting in an invalid self-referential test.

In some cases, tests were updated and "fixed" by plugging in the return values from the test, again resulting in invalid self-referential tests.

In some cases, the assumption was that the differences were due to font differences between the machines, and marked as such, where in fact the code or the test was buggy.

Any test still marked with the 'textfonts' constraint is suspect.

Test 24.11.1 works on Mac OS X, appears to be buggy on Linux and Windows.
Test 27.10 fails on all platforms (there is plenty of room for the numeric 
alignment on the first line, but the calculation for space needed is incorrect).
Test 27.11 has not been rebuilt, as I don't know what it is supposed to 
be testing.

Test 27.5 has differences between windows and Linux/Mac OS X and has been
left marked with 'textfonts' for the time being.
User Comments: fvogel added on 2022-06-11 21:34:34:

Current status: textDisp.test file is now font agnostic to a very large extent, meaning that 'textfonts' constraint could be totally suppressed from test files. Moreover 'failsOnUbuntu' and 'failsOnXQuarz' constraints could be removed from textDisp.test.

Relevant commits are [e8a1d77828] (merge branch less_tests_constraints into core-8-6-branch) and [83493a36bd] (merge into trunk), and [70b152096d] (merge less_test_constraints_revised_text into revised_text).

I'm closing this ticket but I'm leaving branches less_tests_constraints and less_test_constraints_revised_text open so that the work toward removal of more constraints can go on there.


fvogel added on 2021-07-21 20:42:54:
I have started reworking textDisp.test for both the legacy and revised versions of the text widget, see the following branches:

    https://core.tcl-lang.org/tk/vdiff?branch=less_tests_constraints

    https://core.tcl-lang.org/tk/vdiff?branch=less_test_constraints_revised_text

Not yet fully finished though.

bll added on 2017-08-16 15:24:25:
Current font agnostic textDisp.test suite updated (attachment).
27.8 may need fixing later.
27.10.1 is added.
Still need a test to make sure wrapping only wraps to the next line.

Oops...left some debug in, will re-attach.

gcramer added on 2017-07-15 15:35:03:
I think that this is an important improvement, looks very good.

When I have time I will examine why the test cases 24.11.1 and 27.10 are failing. (Currently I'm busy with a bigger release of application Scidb.)

fvogel added on 2017-07-12 18:38:48:
I have tried the proposed textDisp.test on Windows and on Linux Debian 8.

On both platforms results are as reported by the OP (Brad).

Gregor, what's your opinion on this proposal please?

Attachments: