Fossil SCM
Restore the --comfmtflags and --comment-format global command-line options to prevent breaking legacy scripts that use them. But leave them undocumented and marked as decremented. Omit the "comment.test" test file, since it no longer works after syntax improvements in the test-comment-format command and was not actually helping to make the product better.
Commit
6382e25428ddca18e4f2b155c48aa4404fb851ce4c959bb029bfef39837373d3
Parent
b7338a55af95959…
2 files changed
+14
-5
-346
+14
-5
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -639,17 +639,26 @@ | ||
| 639 | 639 | fossil_warning("%s", blob_str(&msg)); |
| 640 | 640 | blob_reset(&msg); |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /* |
| 644 | -** This function attempts to find command line options known to contain | |
| 645 | -** bitwise flags and initializes the associated global variables. After | |
| 646 | -** this function executes, all global variables (i.e. in the "g" struct) | |
| 647 | -** containing option-settable bitwise flag fields must be initialized. | |
| 644 | +** Initialize the g.comFmtFlags global variable. | |
| 645 | +** | |
| 646 | +** Global command-line options --comfmtflags or --comment-format can be | |
| 647 | +** used for this. However, those command-line options are undocumented | |
| 648 | +** and deprecated. They are here for backwards compatibility only. | |
| 648 | 649 | */ |
| 649 | 650 | static void fossil_init_flags_from_options(void){ |
| 650 | - g.comFmtFlags = COMMENT_PRINT_UNSET; /* Use comment-format flag */ | |
| 651 | + const char *zValue = find_option("comfmtflags", 0, 1); | |
| 652 | + if( zValue==0 ){ | |
| 653 | + zValue = find_option("comment-format", 0, 1); | |
| 654 | + } | |
| 655 | + if( zValue ){ | |
| 656 | + g.comFmtFlags = atoi(zValue); | |
| 657 | + }else{ | |
| 658 | + g.comFmtFlags = COMMENT_PRINT_UNSET; /* Command-line option not found. */ | |
| 659 | + } | |
| 651 | 660 | } |
| 652 | 661 | |
| 653 | 662 | /* |
| 654 | 663 | ** Check to see if the Fossil binary contains an appended repository |
| 655 | 664 | ** file using the appendvfs extension. If so, change command-line arguments |
| 656 | 665 | |
| 657 | 666 | DELETED test/comment.test |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -639,17 +639,26 @@ | |
| 639 | fossil_warning("%s", blob_str(&msg)); |
| 640 | blob_reset(&msg); |
| 641 | } |
| 642 | |
| 643 | /* |
| 644 | ** This function attempts to find command line options known to contain |
| 645 | ** bitwise flags and initializes the associated global variables. After |
| 646 | ** this function executes, all global variables (i.e. in the "g" struct) |
| 647 | ** containing option-settable bitwise flag fields must be initialized. |
| 648 | */ |
| 649 | static void fossil_init_flags_from_options(void){ |
| 650 | g.comFmtFlags = COMMENT_PRINT_UNSET; /* Use comment-format flag */ |
| 651 | } |
| 652 | |
| 653 | /* |
| 654 | ** Check to see if the Fossil binary contains an appended repository |
| 655 | ** file using the appendvfs extension. If so, change command-line arguments |
| 656 | |
| 657 | ELETED test/comment.test |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -639,17 +639,26 @@ | |
| 639 | fossil_warning("%s", blob_str(&msg)); |
| 640 | blob_reset(&msg); |
| 641 | } |
| 642 | |
| 643 | /* |
| 644 | ** Initialize the g.comFmtFlags global variable. |
| 645 | ** |
| 646 | ** Global command-line options --comfmtflags or --comment-format can be |
| 647 | ** used for this. However, those command-line options are undocumented |
| 648 | ** and deprecated. They are here for backwards compatibility only. |
| 649 | */ |
| 650 | static void fossil_init_flags_from_options(void){ |
| 651 | const char *zValue = find_option("comfmtflags", 0, 1); |
| 652 | if( zValue==0 ){ |
| 653 | zValue = find_option("comment-format", 0, 1); |
| 654 | } |
| 655 | if( zValue ){ |
| 656 | g.comFmtFlags = atoi(zValue); |
| 657 | }else{ |
| 658 | g.comFmtFlags = COMMENT_PRINT_UNSET; /* Command-line option not found. */ |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | /* |
| 663 | ** Check to see if the Fossil binary contains an appended repository |
| 664 | ** file using the appendvfs extension. If so, change command-line arguments |
| 665 | |
| 666 | ELETED test/comment.test |
D
test/comment.test
-346
| --- a/test/comment.test | ||
| +++ b/test/comment.test | ||
| @@ -1,346 +0,0 @@ | ||
| 1 | -# | |
| 2 | -# Copyright (c) 2014 D. Richard Hipp | |
| 3 | -# | |
| 4 | -# This program is free software; you can redistribute it and/or | |
| 5 | -# modify it under the terms of the Simplified BSD License (also | |
| 6 | -# known as the "2-Clause License" or "FreeBSD License".) | |
| 7 | -# | |
| 8 | -# This program is distributed in the hope that it will be useful, | |
| 9 | -# but without any warranty; without even the implied warranty of | |
| 10 | -# merchantability or fitness for a particular purpose. | |
| 11 | -# | |
| 12 | -# Author contact information: | |
| 13 | -# [email protected] | |
| 14 | -# http://www.hwaci.com/drh/ | |
| 15 | -# | |
| 16 | -############################################################################ | |
| 17 | -# | |
| 18 | -# Test comment formatting and printing. | |
| 19 | -# | |
| 20 | - | |
| 21 | -test_setup "" | |
| 22 | - | |
| 23 | -############################################################################### | |
| 24 | - | |
| 25 | -fossil test-comment-format "" "" | |
| 26 | -test comment-1 {$RESULT eq "\n(1 lines output)"} | |
| 27 | - | |
| 28 | -############################################################################### | |
| 29 | - | |
| 30 | -fossil test-comment-format --decode "" "" | |
| 31 | -test comment-2 {$RESULT eq "\n(1 lines output)"} | |
| 32 | - | |
| 33 | -############################################################################### | |
| 34 | - | |
| 35 | -fossil test-comment-format --width 26 " " "this is a short comment." | |
| 36 | -test comment-3 {$RESULT eq " this is a short comment.\n(1 lines output)"} | |
| 37 | - | |
| 38 | -############################################################################### | |
| 39 | - | |
| 40 | -fossil test-comment-format --width 26 --decode " " "this is a short comment." | |
| 41 | -test comment-4 {$RESULT eq " this is a short comment.\n(1 lines output)"} | |
| 42 | - | |
| 43 | -############################################################################### | |
| 44 | - | |
| 45 | -fossil test-comment-format --width 26 "*PREFIX* " "this is a short comment." | |
| 46 | -test comment-5 {$RESULT eq "*PREFIX* this is a short c\n omment.\n(2 lines output)"} | |
| 47 | - | |
| 48 | -############################################################################### | |
| 49 | - | |
| 50 | -fossil test-comment-format --width 26 --decode "*PREFIX* " "this is a short comment." | |
| 51 | -test comment-6 {$RESULT eq "*PREFIX* this is a short c\n omment.\n(2 lines output)"} | |
| 52 | - | |
| 53 | -############################################################################### | |
| 54 | - | |
| 55 | -fossil test-comment-format --width 26 "" "this\\sis\\sa\\sshort\\scomment." | |
| 56 | -test comment-7 {$RESULT eq "this\\sis\\sa\\sshort\\scommen\nt.\n(2 lines output)"} | |
| 57 | - | |
| 58 | -############################################################################### | |
| 59 | - | |
| 60 | -fossil test-comment-format --width 26 --decode "" "this\\sis\\sa\\sshort\\scomment." | |
| 61 | -test comment-8 {$RESULT eq "this is a short comment.\n(1 lines output)"} | |
| 62 | - | |
| 63 | -############################################################################### | |
| 64 | - | |
| 65 | -fossil test-comment-format --width 78 --decode --trimspace "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly." | |
| 66 | -test comment-9 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test is\n working correctly.\n(2 lines output)"} | |
| 67 | - | |
| 68 | -############################################################################### | |
| 69 | - | |
| 70 | -fossil test-comment-format --width 78 --decode --trimspace "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly. more text here describing the issue.\\nanother line here..................................................................................*" | |
| 71 | -test comment-10 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test is\n working correctly. more text here describing the issue.\n another line here....................................................\n ..............................*\n(4 lines output)"} | |
| 72 | - | |
| 73 | -############################################################################### | |
| 74 | - | |
| 75 | -fossil test-comment-format --width 78 "HH:MM:SS " "....................................................................................*" | |
| 76 | -test comment-11 {$RESULT eq "HH:MM:SS .....................................................................\n ...............*\n(2 lines output)"} | |
| 77 | - | |
| 78 | -############################################################################### | |
| 79 | - | |
| 80 | -fossil test-comment-format --width 78 "HH:MM:SS " ".....................................................................*" 78 | |
| 81 | -test comment-12 {$RESULT eq "HH:MM:SS .....................................................................\n *\n(2 lines output)"} | |
| 82 | - | |
| 83 | -############################################################################### | |
| 84 | - | |
| 85 | -fossil test-comment-format --width 26 "*TEST* " "this\tis a test." | |
| 86 | -test comment-13 {$RESULT eq "*TEST* this\tis a te\n st.\n(2 lines output)"} | |
| 87 | - | |
| 88 | -############################################################################### | |
| 89 | - | |
| 90 | -fossil test-comment-format --width 60 "*TEST* " "this is a test......................................................................................................................." | |
| 91 | -test comment-14 {$RESULT eq "*TEST* this is a test.......................................\n .....................................................\n ...........................\n(3 lines output)"} | |
| 92 | - | |
| 93 | -############################################################################### | |
| 94 | - | |
| 95 | -fossil test-comment-format --width 60 --wordbreak "*TEST* " "this is a test......................................................................................................................." | |
| 96 | -test comment-15 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 97 | - | |
| 98 | -############################################################################### | |
| 99 | - | |
| 100 | -fossil test-comment-format --width 60 "*TEST* " "this is a test......................................................................................................................." | |
| 101 | -test comment-16 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 102 | - | |
| 103 | -############################################################################### | |
| 104 | - | |
| 105 | -fossil test-comment-format --width 60 --wordbreak "*TEST* " "this is a test......................................................................................................................." | |
| 106 | -test comment-17 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 107 | - | |
| 108 | -############################################################################### | |
| 109 | - | |
| 110 | -fossil test-comment-format --width 60 "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 111 | -test comment-18 {$RESULT eq "*TEST* one two three four five six seven eight nine ten elev\n en twelve\n(2 lines output)"} | |
| 112 | - | |
| 113 | -############################################################################### | |
| 114 | - | |
| 115 | -fossil test-comment-format --width 60 --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 116 | -test comment-19 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} | |
| 117 | - | |
| 118 | -############################################################################### | |
| 119 | - | |
| 120 | -fossil test-comment-format --width 60 "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 121 | -test comment-20 {$RESULT eq "*TEST* one two three four five\n six seven eight nine ten\n eleven twelve\n(3 lines output)"} | |
| 122 | - | |
| 123 | -############################################################################### | |
| 124 | - | |
| 125 | -fossil test-comment-format --width 60 --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 126 | -test comment-21 {$RESULT eq "*TEST* one two three four five\n six seven eight nine ten\n eleven twelve\n(3 lines output)"} | |
| 127 | - | |
| 128 | -############################################################################### | |
| 129 | - | |
| 130 | -fossil test-comment-format --legacy "" "" | |
| 131 | -test comment-22 {$RESULT eq "\n(1 lines output)"} | |
| 132 | - | |
| 133 | -############################################################################### | |
| 134 | - | |
| 135 | -fossil test-comment-format --legacy --decode "" "" | |
| 136 | -test comment-23 {$RESULT eq "\n(1 lines output)"} | |
| 137 | - | |
| 138 | -############################################################################### | |
| 139 | - | |
| 140 | -fossil test-comment-format --width 26 --legacy " " "this is a short comment." | |
| 141 | -test comment-24 {$RESULT eq " this is a short comment.\n(1 lines output)"} | |
| 142 | - | |
| 143 | -############################################################################### | |
| 144 | - | |
| 145 | -fossil test-comment-format --width 26 --legacy --decode " " "this is a short comment." | |
| 146 | -test comment-25 {$RESULT eq " this is a short comment.\n(1 lines output)"} | |
| 147 | - | |
| 148 | -############################################################################### | |
| 149 | - | |
| 150 | -fossil test-comment-format --width 25 --legacy "*PREFIX* " "this is a short comment." | |
| 151 | -test comment-26 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"} | |
| 152 | - | |
| 153 | -############################################################################### | |
| 154 | - | |
| 155 | -fossil test-comment-format --width 25 --legacy --decode "*PREFIX* " "this is a short comment." | |
| 156 | -test comment-27 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"} | |
| 157 | - | |
| 158 | -############################################################################### | |
| 159 | - | |
| 160 | -fossil test-comment-format --width 26 --legacy "" "this\\sis\\sa\\sshort\\scomment." | |
| 161 | -test comment-28 {$RESULT eq "this\\sis\\sa\\sshort\\scommen\nt.\n(2 lines output)"} | |
| 162 | - | |
| 163 | -############################################################################### | |
| 164 | - | |
| 165 | -fossil test-comment-format --width 26 --legacy --decode "" "this\\sis\\sa\\sshort\\scomment." | |
| 166 | -test comment-29 {$RESULT eq "this is a short comment.\n(1 lines output)"} | |
| 167 | - | |
| 168 | -############################################################################### | |
| 169 | - | |
| 170 | -fossil test-comment-format --width 78 --legacy --decode "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly." | |
| 171 | -test comment-30 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test\n is working correctly.\n(2 lines output)"} | |
| 172 | - | |
| 173 | -############################################################################### | |
| 174 | - | |
| 175 | -fossil test-comment-format --width 78 --legacy --decode "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly. more text here describing the issue.\\nanother line here..................................................................................*" | |
| 176 | -test comment-31 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test\n is working correctly. more text here describing the issue. another\n line\n here.................................................................\n .................*\n(5 lines output)"} | |
| 177 | - | |
| 178 | -############################################################################### | |
| 179 | - | |
| 180 | -fossil test-comment-format --width 78 --legacy "HH:MM:SS " "....................................................................................*" | |
| 181 | -test comment-32 {$RESULT eq "HH:MM:SS .....................................................................\n ...............*\n(2 lines output)"} | |
| 182 | - | |
| 183 | -############################################################################### | |
| 184 | - | |
| 185 | -fossil test-comment-format --width 78 --legacy "HH:MM:SS " ".....................................................................*" | |
| 186 | -test comment-33 {$RESULT eq "HH:MM:SS .....................................................................\n *\n(2 lines output)"} | |
| 187 | - | |
| 188 | -############################################################################### | |
| 189 | - | |
| 190 | -fossil test-comment-format --width 26 --legacy "*TEST* " "this\tis a test." | |
| 191 | -test comment-34 {$RESULT eq "*TEST* this is a test.\n(1 lines output)"} | |
| 192 | - | |
| 193 | -############################################################################### | |
| 194 | - | |
| 195 | -fossil test-comment-format --width 60 --legacy "*TEST* " "this is a test......................................................................................................................." | |
| 196 | -test comment-35 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 197 | - | |
| 198 | -############################################################################### | |
| 199 | - | |
| 200 | -fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "this is a test......................................................................................................................." | |
| 201 | -test comment-36 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 202 | - | |
| 203 | -############################################################################### | |
| 204 | - | |
| 205 | -fossil test-comment-format --width 60 --legacy "*TEST* " "this is a test......................................................................................................................." | |
| 206 | -test comment-37 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 207 | - | |
| 208 | -############################################################################### | |
| 209 | - | |
| 210 | -fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "this is a test......................................................................................................................." | |
| 211 | -test comment-38 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} | |
| 212 | - | |
| 213 | -############################################################################### | |
| 214 | - | |
| 215 | -fossil test-comment-format --width 60 --legacy "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 216 | -test comment-39 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} | |
| 217 | - | |
| 218 | -############################################################################### | |
| 219 | - | |
| 220 | -fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 221 | -test comment-40 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} | |
| 222 | - | |
| 223 | -############################################################################### | |
| 224 | - | |
| 225 | -fossil test-comment-format --width 60 --legacy "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 226 | -test comment-41 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} | |
| 227 | - | |
| 228 | -############################################################################### | |
| 229 | - | |
| 230 | -fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" | |
| 231 | -test comment-42 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} | |
| 232 | - | |
| 233 | -############################################################################### | |
| 234 | - | |
| 235 | -set orig "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\\nxxxxxxx." | |
| 236 | -fossil test-comment-format --width 73 --decode --origbreak "" $orig | |
| 237 | -test comment-43 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} | |
| 238 | - | |
| 239 | -############################################################################### | |
| 240 | - | |
| 241 | -fossil test-comment-format --width 73 --decode --origbreak "" $orig $orig | |
| 242 | -test comment-44 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} | |
| 243 | - | |
| 244 | -############################################################################### | |
| 245 | - | |
| 246 | -fossil test-comment-format --width 73 --decode --origbreak "" "00:00:00 \[0000000000\] *CURRENT* $orig" $orig | |
| 247 | -test comment-45 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \nxxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(6 lines output)"} | |
| 248 | - | |
| 249 | -############################################################################### | |
| 250 | - | |
| 251 | -fossil test-comment-format --width 82 --indent 9 --decode --origbreak " " $orig | |
| 252 | -test comment-46 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} | |
| 253 | - | |
| 254 | -############################################################################### | |
| 255 | - | |
| 256 | -fossil test-comment-format --width 82 --indent 9 --decode --origbreak " " $orig $orig | |
| 257 | -test comment-47 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} | |
| 258 | - | |
| 259 | -############################################################################### | |
| 260 | - | |
| 261 | -fossil test-comment-format --width 82 --indent 9 --decode --origbreak "00:00:00 " "\[0000000000\] *CURRENT* $orig" $orig | |
| 262 | -test comment-48 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \n xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(6 lines output)"} | |
| 263 | - | |
| 264 | -############################################################################### | |
| 265 | - | |
| 266 | -fossil test-comment-format --width 72 --decode --trimspace --origbreak "" $orig | |
| 267 | -test comment-49 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} | |
| 268 | - | |
| 269 | -############################################################################### | |
| 270 | - | |
| 271 | -fossil test-comment-format --width 72 --decode --trimspace --origbreak "" $orig $orig | |
| 272 | -test comment-50 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} | |
| 273 | - | |
| 274 | -############################################################################### | |
| 275 | - | |
| 276 | -fossil test-comment-format --width 72 --decode --trimspace --origbreak "" "00:00:00 \[0000000000\] *CURRENT* $orig" $orig | |
| 277 | -test comment-51 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \nxxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(6 lines output)"} | |
| 278 | - | |
| 279 | -############################################################################### | |
| 280 | - | |
| 281 | -fossil test-comment-format --width 81 --indent 9 --decode --trimspace --origbreak " " $orig | |
| 282 | -test comment-52 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} | |
| 283 | - | |
| 284 | -############################################################################### | |
| 285 | - | |
| 286 | -fossil test-comment-format --width 81 --indent 9 --decode --trimspace --origbreak " " $orig $orig | |
| 287 | -test comment-53 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} | |
| 288 | - | |
| 289 | -############################################################################### | |
| 290 | - | |
| 291 | -fossil test-comment-format --width 81 --indent 9 --decode --trimspace --origbreak "00:00:00 " "\[0000000000\] *CURRENT* $orig" $orig | |
| 292 | -test comment-54 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \n xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(6 lines output)"} | |
| 293 | - | |
| 294 | -############################################################################### | |
| 295 | - | |
| 296 | -fossil test-comment-format --width 72 --decode --trimcrlf --origbreak "" $orig | |
| 297 | -test comment-55 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} | |
| 298 | - | |
| 299 | -############################################################################### | |
| 300 | - | |
| 301 | -fossil test-comment-format --width 72 --decode --trimcrlf --origbreak "" $orig $orig | |
| 302 | -test comment-56 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} | |
| 303 | - | |
| 304 | -############################################################################### | |
| 305 | - | |
| 306 | -fossil test-comment-format --width 72 --decode --trimcrlf --origbreak "" "00:00:00 \[0000000000\] *CURRENT* $orig" $orig | |
| 307 | -test comment-57 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \nxxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(6 lines output)"} | |
| 308 | - | |
| 309 | -############################################################################### | |
| 310 | - | |
| 311 | -fossil test-comment-format --width 81 --indent 9 --decode --trimcrlf --origbreak " " $orig | |
| 312 | -test comment-58 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} | |
| 313 | - | |
| 314 | -############################################################################### | |
| 315 | - | |
| 316 | -fossil test-comment-format --width 81 --indent 9 --decode --trimcrlf --origbreak " " $orig $orig | |
| 317 | -test comment-59 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} | |
| 318 | - | |
| 319 | -############################################################################### | |
| 320 | - | |
| 321 | -fossil test-comment-format --width 81 --indent 9 --decode --trimcrlf --origbreak "00:00:00 " "\[0000000000\] *CURRENT* $orig" $orig | |
| 322 | -test comment-60 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \n xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(6 lines output)"} | |
| 323 | - | |
| 324 | -############################################################################### | |
| 325 | - | |
| 326 | -fossil test-comment-format --width 72 --file "" [file join $testdir "utf8-comment.txt"] | |
| 327 | -test comment-61 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\] an\nd symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} | |
| 328 | - | |
| 329 | -############################################################################### | |
| 330 | - | |
| 331 | -fossil test-comment-format --width 72 --wordbreak --file "" [file join $testdir "utf8-comment.txt"] | |
| 332 | -test comment-62 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\]\nand symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} | |
| 333 | - | |
| 334 | -############################################################################### | |
| 335 | - | |
| 336 | -fossil test-comment-format --width 72 --legacy --file "" [file join $testdir "utf8-comment.txt"] | |
| 337 | -test comment-63 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\]\nand symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} | |
| 338 | - | |
| 339 | -############################################################################### | |
| 340 | - | |
| 341 | -fossil test-comment-format --width 72 --legacy --wordbreak --file "" [file join $testdir "utf8-comment.txt"] | |
| 342 | -test comment-64 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\]\nand symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} | |
| 343 | - | |
| 344 | -############################################################################### | |
| 345 | - | |
| 346 | -test_cleanup |
| --- a/test/comment.test | |
| +++ b/test/comment.test | |
| @@ -1,346 +0,0 @@ | |
| 1 | # |
| 2 | # Copyright (c) 2014 D. Richard Hipp |
| 3 | # |
| 4 | # This program is free software; you can redistribute it and/or |
| 5 | # modify it under the terms of the Simplified BSD License (also |
| 6 | # known as the "2-Clause License" or "FreeBSD License".) |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, |
| 9 | # but without any warranty; without even the implied warranty of |
| 10 | # merchantability or fitness for a particular purpose. |
| 11 | # |
| 12 | # Author contact information: |
| 13 | # [email protected] |
| 14 | # http://www.hwaci.com/drh/ |
| 15 | # |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Test comment formatting and printing. |
| 19 | # |
| 20 | |
| 21 | test_setup "" |
| 22 | |
| 23 | ############################################################################### |
| 24 | |
| 25 | fossil test-comment-format "" "" |
| 26 | test comment-1 {$RESULT eq "\n(1 lines output)"} |
| 27 | |
| 28 | ############################################################################### |
| 29 | |
| 30 | fossil test-comment-format --decode "" "" |
| 31 | test comment-2 {$RESULT eq "\n(1 lines output)"} |
| 32 | |
| 33 | ############################################################################### |
| 34 | |
| 35 | fossil test-comment-format --width 26 " " "this is a short comment." |
| 36 | test comment-3 {$RESULT eq " this is a short comment.\n(1 lines output)"} |
| 37 | |
| 38 | ############################################################################### |
| 39 | |
| 40 | fossil test-comment-format --width 26 --decode " " "this is a short comment." |
| 41 | test comment-4 {$RESULT eq " this is a short comment.\n(1 lines output)"} |
| 42 | |
| 43 | ############################################################################### |
| 44 | |
| 45 | fossil test-comment-format --width 26 "*PREFIX* " "this is a short comment." |
| 46 | test comment-5 {$RESULT eq "*PREFIX* this is a short c\n omment.\n(2 lines output)"} |
| 47 | |
| 48 | ############################################################################### |
| 49 | |
| 50 | fossil test-comment-format --width 26 --decode "*PREFIX* " "this is a short comment." |
| 51 | test comment-6 {$RESULT eq "*PREFIX* this is a short c\n omment.\n(2 lines output)"} |
| 52 | |
| 53 | ############################################################################### |
| 54 | |
| 55 | fossil test-comment-format --width 26 "" "this\\sis\\sa\\sshort\\scomment." |
| 56 | test comment-7 {$RESULT eq "this\\sis\\sa\\sshort\\scommen\nt.\n(2 lines output)"} |
| 57 | |
| 58 | ############################################################################### |
| 59 | |
| 60 | fossil test-comment-format --width 26 --decode "" "this\\sis\\sa\\sshort\\scomment." |
| 61 | test comment-8 {$RESULT eq "this is a short comment.\n(1 lines output)"} |
| 62 | |
| 63 | ############################################################################### |
| 64 | |
| 65 | fossil test-comment-format --width 78 --decode --trimspace "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly." |
| 66 | test comment-9 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test is\n working correctly.\n(2 lines output)"} |
| 67 | |
| 68 | ############################################################################### |
| 69 | |
| 70 | fossil test-comment-format --width 78 --decode --trimspace "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly. more text here describing the issue.\\nanother line here..................................................................................*" |
| 71 | test comment-10 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test is\n working correctly. more text here describing the issue.\n another line here....................................................\n ..............................*\n(4 lines output)"} |
| 72 | |
| 73 | ############################################################################### |
| 74 | |
| 75 | fossil test-comment-format --width 78 "HH:MM:SS " "....................................................................................*" |
| 76 | test comment-11 {$RESULT eq "HH:MM:SS .....................................................................\n ...............*\n(2 lines output)"} |
| 77 | |
| 78 | ############################################################################### |
| 79 | |
| 80 | fossil test-comment-format --width 78 "HH:MM:SS " ".....................................................................*" 78 |
| 81 | test comment-12 {$RESULT eq "HH:MM:SS .....................................................................\n *\n(2 lines output)"} |
| 82 | |
| 83 | ############################################################################### |
| 84 | |
| 85 | fossil test-comment-format --width 26 "*TEST* " "this\tis a test." |
| 86 | test comment-13 {$RESULT eq "*TEST* this\tis a te\n st.\n(2 lines output)"} |
| 87 | |
| 88 | ############################################################################### |
| 89 | |
| 90 | fossil test-comment-format --width 60 "*TEST* " "this is a test......................................................................................................................." |
| 91 | test comment-14 {$RESULT eq "*TEST* this is a test.......................................\n .....................................................\n ...........................\n(3 lines output)"} |
| 92 | |
| 93 | ############################################################################### |
| 94 | |
| 95 | fossil test-comment-format --width 60 --wordbreak "*TEST* " "this is a test......................................................................................................................." |
| 96 | test comment-15 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 97 | |
| 98 | ############################################################################### |
| 99 | |
| 100 | fossil test-comment-format --width 60 "*TEST* " "this is a test......................................................................................................................." |
| 101 | test comment-16 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 102 | |
| 103 | ############################################################################### |
| 104 | |
| 105 | fossil test-comment-format --width 60 --wordbreak "*TEST* " "this is a test......................................................................................................................." |
| 106 | test comment-17 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 107 | |
| 108 | ############################################################################### |
| 109 | |
| 110 | fossil test-comment-format --width 60 "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 111 | test comment-18 {$RESULT eq "*TEST* one two three four five six seven eight nine ten elev\n en twelve\n(2 lines output)"} |
| 112 | |
| 113 | ############################################################################### |
| 114 | |
| 115 | fossil test-comment-format --width 60 --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 116 | test comment-19 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} |
| 117 | |
| 118 | ############################################################################### |
| 119 | |
| 120 | fossil test-comment-format --width 60 "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 121 | test comment-20 {$RESULT eq "*TEST* one two three four five\n six seven eight nine ten\n eleven twelve\n(3 lines output)"} |
| 122 | |
| 123 | ############################################################################### |
| 124 | |
| 125 | fossil test-comment-format --width 60 --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 126 | test comment-21 {$RESULT eq "*TEST* one two three four five\n six seven eight nine ten\n eleven twelve\n(3 lines output)"} |
| 127 | |
| 128 | ############################################################################### |
| 129 | |
| 130 | fossil test-comment-format --legacy "" "" |
| 131 | test comment-22 {$RESULT eq "\n(1 lines output)"} |
| 132 | |
| 133 | ############################################################################### |
| 134 | |
| 135 | fossil test-comment-format --legacy --decode "" "" |
| 136 | test comment-23 {$RESULT eq "\n(1 lines output)"} |
| 137 | |
| 138 | ############################################################################### |
| 139 | |
| 140 | fossil test-comment-format --width 26 --legacy " " "this is a short comment." |
| 141 | test comment-24 {$RESULT eq " this is a short comment.\n(1 lines output)"} |
| 142 | |
| 143 | ############################################################################### |
| 144 | |
| 145 | fossil test-comment-format --width 26 --legacy --decode " " "this is a short comment." |
| 146 | test comment-25 {$RESULT eq " this is a short comment.\n(1 lines output)"} |
| 147 | |
| 148 | ############################################################################### |
| 149 | |
| 150 | fossil test-comment-format --width 25 --legacy "*PREFIX* " "this is a short comment." |
| 151 | test comment-26 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"} |
| 152 | |
| 153 | ############################################################################### |
| 154 | |
| 155 | fossil test-comment-format --width 25 --legacy --decode "*PREFIX* " "this is a short comment." |
| 156 | test comment-27 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"} |
| 157 | |
| 158 | ############################################################################### |
| 159 | |
| 160 | fossil test-comment-format --width 26 --legacy "" "this\\sis\\sa\\sshort\\scomment." |
| 161 | test comment-28 {$RESULT eq "this\\sis\\sa\\sshort\\scommen\nt.\n(2 lines output)"} |
| 162 | |
| 163 | ############################################################################### |
| 164 | |
| 165 | fossil test-comment-format --width 26 --legacy --decode "" "this\\sis\\sa\\sshort\\scomment." |
| 166 | test comment-29 {$RESULT eq "this is a short comment.\n(1 lines output)"} |
| 167 | |
| 168 | ############################################################################### |
| 169 | |
| 170 | fossil test-comment-format --width 78 --legacy --decode "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly." |
| 171 | test comment-30 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test\n is working correctly.\n(2 lines output)"} |
| 172 | |
| 173 | ############################################################################### |
| 174 | |
| 175 | fossil test-comment-format --width 78 --legacy --decode "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly. more text here describing the issue.\\nanother line here..................................................................................*" |
| 176 | test comment-31 {$RESULT eq "HH:MM:SS this is a long comment that should span multiple lines if the test\n is working correctly. more text here describing the issue. another\n line\n here.................................................................\n .................*\n(5 lines output)"} |
| 177 | |
| 178 | ############################################################################### |
| 179 | |
| 180 | fossil test-comment-format --width 78 --legacy "HH:MM:SS " "....................................................................................*" |
| 181 | test comment-32 {$RESULT eq "HH:MM:SS .....................................................................\n ...............*\n(2 lines output)"} |
| 182 | |
| 183 | ############################################################################### |
| 184 | |
| 185 | fossil test-comment-format --width 78 --legacy "HH:MM:SS " ".....................................................................*" |
| 186 | test comment-33 {$RESULT eq "HH:MM:SS .....................................................................\n *\n(2 lines output)"} |
| 187 | |
| 188 | ############################################################################### |
| 189 | |
| 190 | fossil test-comment-format --width 26 --legacy "*TEST* " "this\tis a test." |
| 191 | test comment-34 {$RESULT eq "*TEST* this is a test.\n(1 lines output)"} |
| 192 | |
| 193 | ############################################################################### |
| 194 | |
| 195 | fossil test-comment-format --width 60 --legacy "*TEST* " "this is a test......................................................................................................................." |
| 196 | test comment-35 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 197 | |
| 198 | ############################################################################### |
| 199 | |
| 200 | fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "this is a test......................................................................................................................." |
| 201 | test comment-36 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 202 | |
| 203 | ############################################################################### |
| 204 | |
| 205 | fossil test-comment-format --width 60 --legacy "*TEST* " "this is a test......................................................................................................................." |
| 206 | test comment-37 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 207 | |
| 208 | ############################################################################### |
| 209 | |
| 210 | fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "this is a test......................................................................................................................." |
| 211 | test comment-38 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"} |
| 212 | |
| 213 | ############################################################################### |
| 214 | |
| 215 | fossil test-comment-format --width 60 --legacy "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 216 | test comment-39 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} |
| 217 | |
| 218 | ############################################################################### |
| 219 | |
| 220 | fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 221 | test comment-40 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} |
| 222 | |
| 223 | ############################################################################### |
| 224 | |
| 225 | fossil test-comment-format --width 60 --legacy "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 226 | test comment-41 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} |
| 227 | |
| 228 | ############################################################################### |
| 229 | |
| 230 | fossil test-comment-format --width 60 --legacy --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" |
| 231 | test comment-42 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"} |
| 232 | |
| 233 | ############################################################################### |
| 234 | |
| 235 | set orig "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\\nxxxxxxx." |
| 236 | fossil test-comment-format --width 73 --decode --origbreak "" $orig |
| 237 | test comment-43 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} |
| 238 | |
| 239 | ############################################################################### |
| 240 | |
| 241 | fossil test-comment-format --width 73 --decode --origbreak "" $orig $orig |
| 242 | test comment-44 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} |
| 243 | |
| 244 | ############################################################################### |
| 245 | |
| 246 | fossil test-comment-format --width 73 --decode --origbreak "" "00:00:00 \[0000000000\] *CURRENT* $orig" $orig |
| 247 | test comment-45 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \nxxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(6 lines output)"} |
| 248 | |
| 249 | ############################################################################### |
| 250 | |
| 251 | fossil test-comment-format --width 82 --indent 9 --decode --origbreak " " $orig |
| 252 | test comment-46 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} |
| 253 | |
| 254 | ############################################################################### |
| 255 | |
| 256 | fossil test-comment-format --width 82 --indent 9 --decode --origbreak " " $orig $orig |
| 257 | test comment-47 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} |
| 258 | |
| 259 | ############################################################################### |
| 260 | |
| 261 | fossil test-comment-format --width 82 --indent 9 --decode --origbreak "00:00:00 " "\[0000000000\] *CURRENT* $orig" $orig |
| 262 | test comment-48 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \n xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(6 lines output)"} |
| 263 | |
| 264 | ############################################################################### |
| 265 | |
| 266 | fossil test-comment-format --width 72 --decode --trimspace --origbreak "" $orig |
| 267 | test comment-49 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} |
| 268 | |
| 269 | ############################################################################### |
| 270 | |
| 271 | fossil test-comment-format --width 72 --decode --trimspace --origbreak "" $orig $orig |
| 272 | test comment-50 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} |
| 273 | |
| 274 | ############################################################################### |
| 275 | |
| 276 | fossil test-comment-format --width 72 --decode --trimspace --origbreak "" "00:00:00 \[0000000000\] *CURRENT* $orig" $orig |
| 277 | test comment-51 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \nxxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(6 lines output)"} |
| 278 | |
| 279 | ############################################################################### |
| 280 | |
| 281 | fossil test-comment-format --width 81 --indent 9 --decode --trimspace --origbreak " " $orig |
| 282 | test comment-52 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} |
| 283 | |
| 284 | ############################################################################### |
| 285 | |
| 286 | fossil test-comment-format --width 81 --indent 9 --decode --trimspace --origbreak " " $orig $orig |
| 287 | test comment-53 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} |
| 288 | |
| 289 | ############################################################################### |
| 290 | |
| 291 | fossil test-comment-format --width 81 --indent 9 --decode --trimspace --origbreak "00:00:00 " "\[0000000000\] *CURRENT* $orig" $orig |
| 292 | test comment-54 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \n xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(6 lines output)"} |
| 293 | |
| 294 | ############################################################################### |
| 295 | |
| 296 | fossil test-comment-format --width 72 --decode --trimcrlf --origbreak "" $orig |
| 297 | test comment-55 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} |
| 298 | |
| 299 | ############################################################################### |
| 300 | |
| 301 | fossil test-comment-format --width 72 --decode --trimcrlf --origbreak "" $orig $orig |
| 302 | test comment-56 {$RESULT eq "xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(5 lines output)"} |
| 303 | |
| 304 | ############################################################################### |
| 305 | |
| 306 | fossil test-comment-format --width 72 --decode --trimcrlf --origbreak "" "00:00:00 \[0000000000\] *CURRENT* $orig" $orig |
| 307 | test comment-57 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \nxxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\nxxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\nxxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\nxxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\nxxxxxxx.\n(6 lines output)"} |
| 308 | |
| 309 | ############################################################################### |
| 310 | |
| 311 | fossil test-comment-format --width 81 --indent 9 --decode --trimcrlf --origbreak " " $orig |
| 312 | test comment-58 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} |
| 313 | |
| 314 | ############################################################################### |
| 315 | |
| 316 | fossil test-comment-format --width 81 --indent 9 --decode --trimcrlf --origbreak " " $orig $orig |
| 317 | test comment-59 {$RESULT eq " xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(5 lines output)"} |
| 318 | |
| 319 | ############################################################################### |
| 320 | |
| 321 | fossil test-comment-format --width 81 --indent 9 --decode --trimcrlf --origbreak "00:00:00 " "\[0000000000\] *CURRENT* $orig" $orig |
| 322 | test comment-60 {$RESULT eq "00:00:00 \[0000000000\] *CURRENT* \n xxxx xx xxxxxxx xxxx xxxxxx xxxxxxx, xxxxxxx, x xxxx xxxxxx xx xxxx xxxx\n xxxxxxx xxxxx xxxx xxxx xx xxxxxxx xxxxxxx (xxxxxx xxxxxxxxx x xxxxx).\n xxx'x xxx xxx xx xxxxx xxxx xxx xxx --xxxxxxxxxxx xxxxxx xx xx xxxx. x\n xxxxx x xxxxxx xxxx xxxx xxxx xxxx xxxx x xxxxx xx xxx x xxxxxxxx\n xxxxxxx.\n(6 lines output)"} |
| 323 | |
| 324 | ############################################################################### |
| 325 | |
| 326 | fossil test-comment-format --width 72 --file "" [file join $testdir "utf8-comment.txt"] |
| 327 | test comment-61 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\] an\nd symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} |
| 328 | |
| 329 | ############################################################################### |
| 330 | |
| 331 | fossil test-comment-format --width 72 --wordbreak --file "" [file join $testdir "utf8-comment.txt"] |
| 332 | test comment-62 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\]\nand symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} |
| 333 | |
| 334 | ############################################################################### |
| 335 | |
| 336 | fossil test-comment-format --width 72 --legacy --file "" [file join $testdir "utf8-comment.txt"] |
| 337 | test comment-63 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\]\nand symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} |
| 338 | |
| 339 | ############################################################################### |
| 340 | |
| 341 | fossil test-comment-format --width 72 --legacy --wordbreak --file "" [file join $testdir "utf8-comment.txt"] |
| 342 | test comment-64 {$RESULT eq "The comment formatter handles fullwidth and multi-byte \[äöü\]\nand symbols \[☃\] and emoji \[💾\] characters!\n(2 lines output)"} |
| 343 | |
| 344 | ############################################################################### |
| 345 | |
| 346 | test_cleanup |
| --- a/test/comment.test | |
| +++ b/test/comment.test | |
| @@ -1,346 +0,0 @@ | |