Tcl Source Code

Check-in [66e3be83ac]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add test-cases, testing the legacy behavior of "format %#d"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA1: 66e3be83acffff59531df962d72ed602ec0240be
User & Date: jan.nijtmans 2017-06-22 08:15:13
Context
2017-06-22
08:59
Upgrade all internal character tables to Unicode 10 check-in: f78dec2d2f user: jan.nijtmans tags: core-8-6-branch
08:16
Merge core-8-6-branch Closed-Leaf check-in: 7a62143dca user: jan.nijtmans tags: bsg-0d-radix-prefix
08:15
Add test-cases, testing the legacy behavior of "format %#d" check-in: 66e3be83ac user: jan.nijtmans tags: core-8-6-branch
2017-06-18
14:01
Factor out chunk of non-obvious code in the guts of [oo::define] into one place. check-in: 2bcf10b88e user: dkf tags: core-8-6-branch
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to doc/GetInt.3.

     1      1   '\"
     2      2   '\" Copyright (c) 1989-1993 The Regents of the University of California.
     3      3   '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
     4      4   '\"
     5      5   '\" See the file "license.terms" for information on usage and redistribution
     6      6   '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
     7         -'\" 
            7  +'\"
     8      8   .TH Tcl_GetInt 3 "" Tcl "Tcl Library Procedures"
     9      9   .so man.macros
    10     10   .BS
    11     11   .SH NAME
    12     12   Tcl_GetInt, Tcl_GetDouble, Tcl_GetBoolean \- convert from string to integer, double, or boolean
    13     13   .SH SYNOPSIS
    14     14   .nf

Changes to tests/format.test.

    74     74   } {0     06                   042                  041033               037777777764        }
    75     75   test format-1.11.1 {integer formatting} longIs64bit {
    76     76       format "%-#5o %-#20o %#-20o %#-20o %#-20o" 0 6 34 16923 -12 -1
    77     77   } {0     06                   042                  041033               01777777777777777777764}
    78     78   test format-1.12 {integer formatting} {
    79     79       format "%b %#b %#b %llb" 5 0 5 [expr {2**100}]
    80     80   } {101 0b0 0b101 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}
           81  +test format-1.13 {integer formatting} longIs32bit {
           82  +    format "%#d %#d %#d %#d %#d" 0 6 34 16923 -12 -1
           83  +} {0 6 34 16923 -12}
           84  +test format-1.13.1 {integer formatting} longIs64bit {
           85  +    format "%#d %#d %#d %#d %#d" 0 6 34 16923 -12 -1
           86  +} {0 6 34 16923 -12}
           87  +test format-1.14 {integer formatting} longIs32bit {
           88  +    format "%#5d %#20d %#20d %#20d %#20d" 0 6 34 16923 -12 -1
           89  +} {    0                    6                   34                16923                  -12}
           90  +test format-1.14.1 {integer formatting} longIs64bit {
           91  +    format "%#5d %#20d %#20d %#20d %#20d" 0 6 34 16923 -12 -1
           92  +} {    0                    6                   34                16923                  -12}
           93  +test format-1.15 {integer formatting} longIs32bit {
           94  +    format "%-#5d %-#20d %-#20d %-#20d %-#20d" 0 6 34 16923 -12 -1
           95  +} {0     6                    34                   16923                -12                 }
           96  +test format-1.15.1 {integer formatting} longIs64bit {
           97  +    format "%-#5d %-#20d %-#20d %-#20d %-#20d" 0 6 34 16923 -12 -1
           98  +} {0     6                    34                   16923                -12                 }
           99  +
    81    100   
    82    101   test format-2.1 {string formatting} {
    83    102       format "%s %s %c %s" abcd {This is a very long test string.} 120 x
    84    103   } {abcd This is a very long test string. x x}
    85    104   test format-2.2 {string formatting} {
    86    105       format "%20s %20s %20c %20s" abcd {This is a very long test string.} 120 x
    87    106   } {                abcd This is a very long test string.                    x                    x}

Changes to tests/util.test.

   204    204   } {a c}
   205    205   test util-4.6 {Tcl_ConcatObj - utf-8 sequence with "whitespace" char} {
   206    206       # Check for Bug #227512.  If this violates C isspace, then it returns \xc3.
   207    207       concat \xe0
   208    208   } \xe0
   209    209   test util-4.7 {Tcl_ConcatObj - refCount safety} testconcatobj {
   210    210       # Check for Bug #1447328 (actually, bugs in its original "fix"). One of the
   211         -    # symptoms was Bug #2055782. 
          211  +    # symptoms was Bug #2055782.
   212    212       testconcatobj
   213    213   } {}
   214    214   
   215    215   proc Wrapper_Tcl_StringMatch {pattern string} {
   216    216       # Forces use of Tcl_StringMatch, not Tcl_UniCharCaseMatch
   217    217       switch -glob -- $string $pattern {return 1} default {return 0}
   218    218   }
................................................................................
   562    562       string index abcdefghijk 0xa
   563    563   } k
   564    564   test util-9.1.3 {TclGetIntForIndex} {
   565    565       string index abcdefghijk { 0xa }
   566    566   } k
   567    567   test util-9.2.0 {TclGetIntForIndex} {
   568    568       string index abcd end
   569         -} d 
          569  +} d
   570    570   test util-9.2.1 {TclGetIntForIndex} -body {
   571    571       string index abcd { end}
   572    572   } -returnCodes error -match glob -result *
   573    573   test util-9.2.2 {TclGetIntForIndex} -body {
   574    574       string index abcd {end }
   575    575   } -returnCodes error -match glob -result *
   576    576   test util-9.3 {TclGetIntForIndex} {
................................................................................
  4003   4003   	binary scan [binary format q [expr double($input)]] wu x
  4004   4004   	lappend r [format %#llx $x]
  4005   4005   	binary scan [binary format q [expr double(-$input)]] wu x
  4006   4006   	lappend r [format %#llx $x]
  4007   4007       }
  4008   4008       set r
  4009   4009   } [list {*}{
  4010         -    0x43fffffffffffffc 0xc3fffffffffffffc 
         4010  +    0x43fffffffffffffc 0xc3fffffffffffffc
  4011   4011       0x43fffffffffffffc 0xc3fffffffffffffc
  4012   4012       0x43fffffffffffffd 0xc3fffffffffffffd
  4013   4013       0x43fffffffffffffe 0xc3fffffffffffffe
  4014   4014       0x43fffffffffffffe 0xc3fffffffffffffe
  4015   4015       0x43fffffffffffffe 0xc3fffffffffffffe
  4016   4016       0x43ffffffffffffff 0xc3ffffffffffffff
  4017   4017       0x4400000000000000 0xc400000000000000