Fossil SCM

Add and adjust comment tests from the experimental branch.

mistachkin 2014-06-20 19:11 trunk
Commit 2920e7df00b9d96acb50f8b3249eb75a85fad4ba
--- src/comformat.c
+++ src/comformat.c
@@ -139,16 +139,18 @@
139139
** Test comment formatting and printing. Use for testing only.
140140
**
141141
** Options:
142142
** --decode Decode the text using the same method used when
143143
** handling the value of a C-card from a manifest.
144
+** --wordbreak This does nothing and is ignored.
144145
*/
145146
void test_comment_format(void){
146147
const char *zPrefix;
147148
char *zText;
148149
int indent, width;
149150
int decode = find_option("decode", 0, 0)!=0;
151
+ find_option("wordbreak", 0, 0); /* NOT USED */
150152
if( g.argc!=4 && g.argc!=5 ){
151153
usage("PREFIX TEXT ?WIDTH?");
152154
}
153155
zPrefix = g.argv[2];
154156
if( decode ){
155157
--- src/comformat.c
+++ src/comformat.c
@@ -139,16 +139,18 @@
139 ** Test comment formatting and printing. Use for testing only.
140 **
141 ** Options:
142 ** --decode Decode the text using the same method used when
143 ** handling the value of a C-card from a manifest.
 
144 */
145 void test_comment_format(void){
146 const char *zPrefix;
147 char *zText;
148 int indent, width;
149 int decode = find_option("decode", 0, 0)!=0;
 
150 if( g.argc!=4 && g.argc!=5 ){
151 usage("PREFIX TEXT ?WIDTH?");
152 }
153 zPrefix = g.argv[2];
154 if( decode ){
155
--- src/comformat.c
+++ src/comformat.c
@@ -139,16 +139,18 @@
139 ** Test comment formatting and printing. Use for testing only.
140 **
141 ** Options:
142 ** --decode Decode the text using the same method used when
143 ** handling the value of a C-card from a manifest.
144 ** --wordbreak This does nothing and is ignored.
145 */
146 void test_comment_format(void){
147 const char *zPrefix;
148 char *zText;
149 int indent, width;
150 int decode = find_option("decode", 0, 0)!=0;
151 find_option("wordbreak", 0, 0); /* NOT USED */
152 if( g.argc!=4 && g.argc!=5 ){
153 usage("PREFIX TEXT ?WIDTH?");
154 }
155 zPrefix = g.argv[2];
156 if( decode ){
157
--- test/comment.test
+++ test/comment.test
@@ -26,16 +26,16 @@
2626
fossil test-comment-format --decode "" ""
2727
test comment-2 {$RESULT eq "\n(1 lines output)"}
2828
2929
###############################################################################
3030
31
-fossil test-comment-format " " "this is a short comment." 25
31
+fossil test-comment-format " " "this is a short comment." 26
3232
test comment-3 {$RESULT eq " this is a short comment.\n(1 lines output)"}
3333
3434
###############################################################################
3535
36
-fossil test-comment-format --decode " " "this is a short comment." 25
36
+fossil test-comment-format --decode " " "this is a short comment." 26
3737
test comment-4 {$RESULT eq " this is a short comment.\n(1 lines output)"}
3838
3939
###############################################################################
4040
4141
fossil test-comment-format "*PREFIX* " "this is a short comment." 25
@@ -46,12 +46,77 @@
4646
fossil test-comment-format --decode "*PREFIX* " "this is a short comment." 25
4747
test comment-6 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"}
4848
4949
###############################################################################
5050
51
-fossil test-comment-format "" "this\\sis\\sa\\sshort\\scomment."
52
-test comment-7 {$RESULT eq "this\\sis\\sa\\sshort\\scomment.\n(1 lines output)"}
51
+fossil test-comment-format "" "this\\sis\\sa\\sshort\\scomment." 26
52
+test comment-7 {$RESULT eq "this\\sis\\sa\\sshort\\scommen\nt.\n(2 lines output)"}
53
+
54
+###############################################################################
55
+
56
+fossil test-comment-format --decode "" "this\\sis\\sa\\sshort\\scomment." 26
57
+test comment-8 {$RESULT eq "this is a short comment.\n(1 lines output)"}
58
+
59
+###############################################################################
60
+
61
+fossil test-comment-format --decode "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly." 78
62
+test comment-9 {$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)"}
63
+
64
+###############################################################################
65
+
66
+fossil test-comment-format --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..................................................................................*" 78
67
+test comment-10 {$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)"}
68
+
69
+###############################################################################
70
+
71
+fossil test-comment-format "HH:MM:SS " "....................................................................................*" 78
72
+test comment-11 {$RESULT eq "HH:MM:SS .....................................................................\n ...............*\n(2 lines output)"}
73
+
74
+###############################################################################
75
+
76
+fossil test-comment-format "HH:MM:SS " ".....................................................................*" 78
77
+test comment-12 {$RESULT eq "HH:MM:SS .....................................................................\n *\n(2 lines output)"}
78
+
79
+###############################################################################
80
+
81
+fossil test-comment-format "*TEST* " "this\tis a test." 26
82
+test comment-13 {$RESULT eq "*TEST* this is a test.\n(1 lines output)"}
83
+
84
+###############################################################################
85
+
86
+fossil test-comment-format "*TEST* " "this is a test......................................................................................................................." 60
87
+test comment-14 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
88
+
89
+###############################################################################
90
+
91
+fossil test-comment-format --wordbreak "*TEST* " "this is a test......................................................................................................................." 60
92
+test comment-15 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
93
+
94
+###############################################################################
95
+
96
+fossil test-comment-format "*TEST* " "this is a test......................................................................................................................." 60
97
+test comment-16 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
98
+
99
+###############################################################################
100
+
101
+fossil test-comment-format --wordbreak "*TEST* " "this is a test......................................................................................................................." 60
102
+test comment-17 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
103
+
104
+###############################################################################
105
+
106
+fossil test-comment-format "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
107
+test comment-18 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
108
+
109
+###############################################################################
110
+
111
+fossil test-comment-format --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
112
+test comment-19 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
113
+
114
+###############################################################################
115
+
116
+fossil test-comment-format "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
117
+test comment-20 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
53118
54119
###############################################################################
55120
56
-fossil test-comment-format --decode "" "this\\sis\\sa\\sshort\\scomment."
57
-test comment-8 {$RESULT eq "this is a short comment.\n(1 lines output)"}
121
+fossil test-comment-format --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
122
+test comment-21 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
58123
--- test/comment.test
+++ test/comment.test
@@ -26,16 +26,16 @@
26 fossil test-comment-format --decode "" ""
27 test comment-2 {$RESULT eq "\n(1 lines output)"}
28
29 ###############################################################################
30
31 fossil test-comment-format " " "this is a short comment." 25
32 test comment-3 {$RESULT eq " this is a short comment.\n(1 lines output)"}
33
34 ###############################################################################
35
36 fossil test-comment-format --decode " " "this is a short comment." 25
37 test comment-4 {$RESULT eq " this is a short comment.\n(1 lines output)"}
38
39 ###############################################################################
40
41 fossil test-comment-format "*PREFIX* " "this is a short comment." 25
@@ -46,12 +46,77 @@
46 fossil test-comment-format --decode "*PREFIX* " "this is a short comment." 25
47 test comment-6 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"}
48
49 ###############################################################################
50
51 fossil test-comment-format "" "this\\sis\\sa\\sshort\\scomment."
52 test comment-7 {$RESULT eq "this\\sis\\sa\\sshort\\scomment.\n(1 lines output)"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
54 ###############################################################################
55
56 fossil test-comment-format --decode "" "this\\sis\\sa\\sshort\\scomment."
57 test comment-8 {$RESULT eq "this is a short comment.\n(1 lines output)"}
58
--- test/comment.test
+++ test/comment.test
@@ -26,16 +26,16 @@
26 fossil test-comment-format --decode "" ""
27 test comment-2 {$RESULT eq "\n(1 lines output)"}
28
29 ###############################################################################
30
31 fossil test-comment-format " " "this is a short comment." 26
32 test comment-3 {$RESULT eq " this is a short comment.\n(1 lines output)"}
33
34 ###############################################################################
35
36 fossil test-comment-format --decode " " "this is a short comment." 26
37 test comment-4 {$RESULT eq " this is a short comment.\n(1 lines output)"}
38
39 ###############################################################################
40
41 fossil test-comment-format "*PREFIX* " "this is a short comment." 25
@@ -46,12 +46,77 @@
46 fossil test-comment-format --decode "*PREFIX* " "this is a short comment." 25
47 test comment-6 {$RESULT eq "*PREFIX* this is a short\n comment.\n(2 lines output)"}
48
49 ###############################################################################
50
51 fossil test-comment-format "" "this\\sis\\sa\\sshort\\scomment." 26
52 test comment-7 {$RESULT eq "this\\sis\\sa\\sshort\\scommen\nt.\n(2 lines output)"}
53
54 ###############################################################################
55
56 fossil test-comment-format --decode "" "this\\sis\\sa\\sshort\\scomment." 26
57 test comment-8 {$RESULT eq "this is a short comment.\n(1 lines output)"}
58
59 ###############################################################################
60
61 fossil test-comment-format --decode "HH:MM:SS " "this is a long comment that should span multiple lines if the test is working correctly." 78
62 test comment-9 {$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)"}
63
64 ###############################################################################
65
66 fossil test-comment-format --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..................................................................................*" 78
67 test comment-10 {$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)"}
68
69 ###############################################################################
70
71 fossil test-comment-format "HH:MM:SS " "....................................................................................*" 78
72 test comment-11 {$RESULT eq "HH:MM:SS .....................................................................\n ...............*\n(2 lines output)"}
73
74 ###############################################################################
75
76 fossil test-comment-format "HH:MM:SS " ".....................................................................*" 78
77 test comment-12 {$RESULT eq "HH:MM:SS .....................................................................\n *\n(2 lines output)"}
78
79 ###############################################################################
80
81 fossil test-comment-format "*TEST* " "this\tis a test." 26
82 test comment-13 {$RESULT eq "*TEST* this is a test.\n(1 lines output)"}
83
84 ###############################################################################
85
86 fossil test-comment-format "*TEST* " "this is a test......................................................................................................................." 60
87 test comment-14 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
88
89 ###############################################################################
90
91 fossil test-comment-format --wordbreak "*TEST* " "this is a test......................................................................................................................." 60
92 test comment-15 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
93
94 ###############################################################################
95
96 fossil test-comment-format "*TEST* " "this is a test......................................................................................................................." 60
97 test comment-16 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
98
99 ###############################################################################
100
101 fossil test-comment-format --wordbreak "*TEST* " "this is a test......................................................................................................................." 60
102 test comment-17 {$RESULT eq "*TEST* this is a\n test.................................................\n .....................................................\n .................\n(4 lines output)"}
103
104 ###############################################################################
105
106 fossil test-comment-format "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
107 test comment-18 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
108
109 ###############################################################################
110
111 fossil test-comment-format --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
112 test comment-19 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
113
114 ###############################################################################
115
116 fossil test-comment-format "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
117 test comment-20 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
118
119 ###############################################################################
120
121 fossil test-comment-format --wordbreak "*TEST* " "one two three four five six seven eight nine ten eleven twelve" 60
122 test comment-21 {$RESULT eq "*TEST* one two three four five six seven eight nine ten\n eleven twelve\n(2 lines output)"}
123

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button