Debian Codegraph @

tests/test.tar

raw
1 ciftest0010066400001450000012000000000000710621724200123010ustar00bmstaff00000400000056ciftest1010066400001450000012000000000650710621727400123220ustar00bmstaff00000400000056# Purpose: a file containing only a CIF comment line
2 ciftest2010066400001450000012000000001030710622002000122730ustar00bmstaff00000400000056# Purpose: a CIF containing only a null data block
3 data_null_block
4 ciftest3010066400001450000012000000001040710622005600123060ustar00bmstaff00000400000056# Purpose: a minimal CIF with content
5 data_null_block
6 _item char
7 ciftest4010066400001450000012000000004540710622460000123160ustar00bmstaff00000400000056# Purpose: simple valid file conforming to CIF syntax
8
9 data_model
10
11 _d1 char
12 _d2 'model file'
13 _d3 "with various types of field"
14 _d4 # Comment
15 ; all conforming to valid STAR/CIF syntax
16 rules
17 ;
18
19 loop_
20
21 _d5
22 _d6
23 _d7
24 _d8
25
26 A B C D
27 E F G H # Comment within the body of a loop
28 I J K L
29 ciftest5010066400001450000012000000054140710623505400123250ustar00bmstaff00000400000056# Purpose: valid STAR/CIF file with potential traps for lazy parsers
30
31 # The first data block is the model block of ciftest4
32
33 data_model
34
35 _d1 char
36 _d2 'model file'
37 _d3 "with various types of field"
38 _d4 # Comment
39 ; all conforming to valid STAR syntax
40 rules
41 ;
42
43 loop_
44
45 _d5
46 _d6
47 _d7
48 _d8
49
50 A B C D
51 E F G H # Comment within the body of a loop
52 I J K L
53
54 # The second block is valid, but has (potential) traps
55
56 data_test # Not at the beginning of a line!
57
58 # Data items can occur anywhere in a line, not just at the
59 # beginning; and several can appear on one line (if they fit).
60 # Also, some values may appear on the next or subsequent lines.
61 _t1 char
62 _t2 ' model file '
63 _t2a 'some aren't half tricky' _t2b ' some aren't easy '
64 _t3 "with various types of field" # Comment
65 _t4
66 ;
67 all conforming to valid STAR syntax rules
68 ;
69 _t5
70
71 'beware of intervening line endings and blank lines'
72
73 # Beware also of other non-white-space token separators (especially TAB)
74
75 _t6 'there was a TAB character just after the data name'
76
77
78 # Loops can be nicely laid out, but don't have to be!
79 loop_ _t7 _t8 _t9 _t10 A B C D E F G H I J K L
80 loop_ _t11
81 _t12 _t13 _t14 a b c d e f
82 g h i j
83 k l
84
85 # Degenerate loop
86 loop_ _t15 0 1 2 3 4 5 6 7 8 9
87
88 # Loops can contain various data types and with intermingled comments
89 loop_
90 _t16
91 _t17
92 _t18
93 _t19
94
95 1 2 3 4
96 the quick brown fox # four different values here!
97 'jumps over' the lazy style
98 5 6 7
99 ; and they all went home to tea
100 ;
101 9 10 11 12
102
103 # A few miscellaneous gotchas
104
105 _t20
106 ; An embedded ' _dataname' within quotes in a text block was once flagged as
107 an error.
108 ;
109
110 _t21
111 ; So was an instance where a valid
112 _dataname was the first word on the
113 line within a text block.
114 ; data_test2 # Note that data_ tags can be within a line!
115
116
117 # Here are a few valid datanames with non-alphanumeric characters
118
119 _funny_dataname__1 OK
120 _funny_dataname_#2 OK
121 _funny_!"#$%^&*()_+-={}[]:@~;'#<>?,./_dataname_3 OK
122
123 data_test3
124 # A harsh test of white-space parsing
125
126 # In this loop there is a control-K (ASCII decimal 11, vertical tab)
127 # between A and B, a control-L (ASCII decimal 12, page throw)
128 # between E and F, and a control-M (ASCII decimal 13, carriage
129 # return between I and J)
130 loop_
131
132 _d5
133 _d6
134 _d7
135 _d8
136
137 A B C D
138 E F G H # Comment
139 I J K L
140 ciftest6010066400001450000012000000007070710623474000123270ustar00bmstaff00000400000056# Purpose: error CIF: lacks initial data statement; other data_ faults
141
142 _d1 char
143 _d2 'model file'
144 _d3 "with various types of field"
145 _d4 # Comment
146 ; all conforming to valid STAR syntax
147 rules
148 ;
149
150 loop_
151
152 _d5
153 _d6
154 _d7
155 _d8
156
157 A B C D
158 E F G H # Comment within the body of a loop
159 I J K L
160
161
162 data_ # No identifier to data_
163
164 _d9 char
165
166 data_test
167
168 loop_ _t1 0 1 2 3 4 5 6 7 8 9
169
170 data_test # Duplicate data_ identifier
171
172 _t2 char
173 ciftest7010066400001450000012000000014060710622376100123260ustar00bmstaff00000400000056# Purpose: incorrectly terminated character strings - a common problem
174
175 data_test
176
177 _t1 char
178 _e2 'no longer a model file # no closing quote
179 _e3 no longer a model file # no quotes at all
180 _e4 "with various types of field' # mismatched quotes
181 _t5 "but it's OK to have included quotes of the other type"
182 _t6 'and it's even OK to have included quotes of the same type"
183 _e7 'so long as they don' t abut white space!'
184 _t8 # Comment
185 ; all conforming to valid STAR syntax
186 rules
187 ; _t9 "Watch out for content following the text terminator" # OK
188 _e10
189 ; but here is an incorrectly indented
190 text field
191 ;
192 _e11
193 ; and here is the all-too-common case of
194 a missing text terminator
195
196 _e12
197 ; a parser should now complain
198 # mismatched quotes
199 _t5 "but it's OK to have included quotes of the other type"
200 _t6 'and it's even OK to have included quotes of the same type"
201 _e7 'so long as they don' t abut white space!'
202 _t8 # Comment
203 ; all conforming to valid STciftest8010066400001450000012000000007420710623477100123340ustar00bmstaff00000400000056# Purpose: wrong line and dataname lengths - valid STAR, broken CIF
204
205 data_test
206
207 _rather_long_dataname_1 OK
208 _even_longer_dataname_but_still_valid_2 'breaks original 32 char CIF spec'
209 _on_the_other_hand_this_dataname_runs_longer_than_the_permitted_80_character_width_of_CIF
210 "and therefore is invalid"
211 _short_dataname_4
212 'in this case the dataname is valid, but now the value runs to a width greater than 80 chars'
213
214 loop_
215
216 _d5
217 _d6
218 _d7
219 _d8
220
221 A B C D
222 E F G H # Comment
223 I J K L
224 ciftest9010066400001450000012000000013640710622557500123400ustar00bmstaff00000400000056# Purpose: things wrong with loops
225
226 data_model
227
228 _d1 char
229 _d2 'model file'
230 _d3 "with various types of field"
231 _d4 # Comment
232 ; all conforming to valid STAR syntax
233 rules
234 ;
235
236 loop_ # This one is OK
237
238 _d5
239 _d6
240 _d7
241 _d8
242
243 A B C D
244 E F G H # Comment
245 I J K L
246
247 loop_ _a1 _a2 _a3 0 1 2 3 4 5 6 7 8 9 # Too many values
248
249 # No loop header
250 _b5 _b6 _b7 _b8
251 A B C D E F G H I J K L
252
253 # Too many loop keywords
254 loop_ loop_ _c5 _c6 _c7 _c8
255 A B C D E F G H I J K L
256
257 # Perhaps a formatting mistake - the effect is of a single degenerate
258 # loop, followed by a single data item (_d10 5) and hanging values
259 loop_ _d9 0 1 2 3 4
260 _d10 5 6 7 8 9
261
262 loop_ A B C D # Missing datanames in loop header
263
264 loop_ _d11 _d12 _d13 _d14 # No values
265 ciftest10010066400001450000012000000012170710623216500123760ustar00bmstaff00000400000056# Purpose: non-printing characters
266
267 # This file contains control-K, control-L and control-M "white-space"
268 # characters in the loop, which should parse without error. But there
269 # are other illegal non-printing characters.
270
271 data_model
272
273 _d1 char
274 _d2 'model file'
275 _d3 "with various types of field"
276 _d4 # Control-G in the next text field
277 ; all conforming to valid STAR syntax 
278 rules
279 ;
280
281 loop_
282
283 _d5
284 _d6
285 _d7
286 _d8
287
288 A B C D
289 E F G H # Comment
290 I J K L
291
292
293 # File ends with a control-Z (sometimes appended by DOS programs) - this
294 # should be flagged both as an illegal character and as a surplus member
295 # of the loop above!
296 
297 ciftest11010066400001450000012000000024340710623322200123740ustar00bmstaff00000400000056# Purpose: line endings - should parse OK
298
299 # The physical structure of this file needs to be considered carefully.
300 # It was generated as a text file on a Unix machine, and then a
301 # control-M (ASCII decimal 13, carriage return) was appended to the end
302 # of each line of text. Because the Unix newline character is control-J
303 # (ASCII decimal 10, newline), each line is terminated by a
304 # control-M/control-J pairing, and - by chance - this digraph
305 # corresponds to a DOS new-line indicator. A file constructed entirely
306 # in this way and mounted e.g. on an NFS filesystem would be valid
307 # (but not identical) on both Windows and Unix platforms.
308
309 data_model2
310
311 _d1 char
312 _d2 ' model file '
313 _d2a 'some aren't half tricky' _d2b ' some aren't easy '
314 _d3 "with various types of field" # Comment
315 _d4
316 ;
317 all conforming to valid STAR syntax rules
318 ;
319 loop_ _d5 _d6 _d7 _d8 A B C D E F G H I J K L
320 loop_ _p5 _p6 _p7 _p8 a b c d e f g h i j k l
321
322 loop_ _d9 0 1 2 3 4 5 6 7 8 9
323
324 loop_ # with various data types
325 _a1
326 _a2
327 _a3
328 _a4
329
330 1 2 3 4
331 the quick brown fox
332 'jumps over' the lazy style
333 5 6 7
334 ; and they all went home to tea
335 ;
336 9 10 11 12
337 ciftest0.result.canon010066400001450000012000000000230710623446400147250ustar00bmstaff00000400000056WARNING: Null file
338 ciftest1.result.canon010066400001450000012000000000230710623446400147260ustar00bmstaff00000400000056WARNING: Null file
339 ciftest10.result.canon010066400001450000012000000002620710623446400150130ustar00bmstaff00000400000056WARNING: Non-printable ASCII character \07 at line 13
340 WARNING: Non-printable ASCII character \032 at line 32
341 ERROR: Number of loop elements not multiple of packetsize at line 32
342 ciftest11.result.canon010066400001450000012000000000000710623446400150020ustar00bmstaff00000400000056ciftest2.result.canon010066400001450000012000000000470710623446400147350ustar00bmstaff00000400000056WARNING: Null datablock at end of file
343 ciftest3.result.canon010066400001450000012000000000000710623446400147230ustar00bmstaff00000400000056ciftest4.result.canon010066400001450000012000000000000710623446400147240ustar00bmstaff00000400000056ciftest5.result.canon010066400001450000012000000000000710623446400147250ustar00bmstaff00000400000056ciftest6.result.canon010066400001450000012000000002360710623446400147410ustar00bmstaff00000400000056ERROR: No data block code before dataname at line 3
344 ERROR: data_ declaration at line 23 needs identifier
345 ERROR: Duplicate datablock name data_test at line 31
346 ciftest7.result.canon010066400001450000012000000022010710623446400147340ustar00bmstaff00000400000056ERROR: Single-quoted character string does not terminate at line 6
347 ERROR: Unexpected string (longer) at line 7
348 ERROR: Unexpected string (a) at line 7
349 ERROR: Unexpected string (model) at line 7
350 ERROR: Unexpected string (file) at line 7
351 ERROR: Double-quoted character string does not terminate at line 8
352 ERROR: Single-quoted character string does not terminate at line 10
353 ERROR: Unexpected string (t) at line 11
354 ERROR: Unexpected string (abut) at line 11
355 ERROR: Unexpected string (white) at line 11
356 ERROR: Unexpected string (space!') at line 11
357 ERROR: Unexpected string (but) at line 17
358 ERROR: Unexpected string (here) at line 17
359 ERROR: Unexpected string (is) at line 17
360 ERROR: Unexpected string (an) at line 17
361 ERROR: Unexpected string (incorrectly) at line 17
362 ERROR: Unexpected string (indented) at line 17
363 ERROR: Unexpected string (text) at line 18
364 ERROR: Unexpected string (field) at line 18
365 ERROR: Unexpected string (;) at line 19
366 ERROR: Unexpected string (a) at line 25
367 ERROR: Unexpected string (parser) at line 25
368 ERROR: Unexpected string (should) at line 25
369 ERROR: Unexpected string (now) at line 25
370 ERROR: Unexpected string (complain) at line 25
371 ciftest8.result.canon010066400001450000012000000002740710625013700147400ustar00bmstaff00000400000056CIF ERROR: Line 7 exceeds 80 characters
372 CIF ERROR: Line 7: dataname exceeds 74 characters (_on_the_other_hand_this_dataname_runs_longer_than_t...)
373 CIF ERROR: Line 10 exceeds 80 characters
374 ciftest9.result.canon010066400001450000012000000020140710623446400147400ustar00bmstaff00000400000056ERROR: Number of loop elements not multiple of packetsize at line 27
375 ERROR: Value missing at line 27
376 ERROR: Value missing at line 27
377 ERROR: Value missing at line 27
378 ERROR: Unexpected string (B) at line 28
379 ERROR: Unexpected string (C) at line 28
380 ERROR: Unexpected string (D) at line 28
381 ERROR: Unexpected string (E) at line 28
382 ERROR: Unexpected string (F) at line 28
383 ERROR: Unexpected string (G) at line 28
384 ERROR: Unexpected string (H) at line 28
385 ERROR: Unexpected string (I) at line 28
386 ERROR: Unexpected string (J) at line 28
387 ERROR: Unexpected string (K) at line 28
388 ERROR: Unexpected string (L) at line 28
389 ERROR: Redundant loop_ keyword at line 31
390 ERROR: Unexpected string (6) at line 37
391 ERROR: Unexpected string (7) at line 37
392 ERROR: Unexpected string (8) at line 37
393 ERROR: Unexpected string (9) at line 37
394 ERROR: loop_ keyword not followed by dataname at line 39
395 ERROR: Unexpected string (B) at line 39
396 ERROR: Unexpected string (C) at line 39
397 ERROR: Unexpected string (D) at line 39
398 ERROR: Loop takes no data values before end of file
399 runtests010077500001450000012000000025720710623442300124720ustar00bmstaff00000400000056#!/bin/sh
400
401 ##############################################################################
402 # small wrapper script to run the STAR/CIF syntax test suite #
403 ##############################################################################
404
405 CLEAR="tput clear" # command to clear screen
406
407 for F in ciftest[0-9] ciftest[0-9][0-9]
408 do
409 ${CLEAR}
410 echo "=============================================================="
411 # Diplay purpose (with trick for empty file)
412 echo $F
413 if grep "# Purpose" $F
414 then
415 true
416 else
417 if [ -s $F ]
418 then
419 true
420 else
421 echo "# Purpose: null file"
422 fi
423 fi
424
425 # Test with vcif
426 echo
427 echo "--------------------------------------------------------------"
428 echo "Testing against CIF syntax"
429 echo
430
431 vcif $F > $F.result
432 if [ -s $F.result ]
433 then
434 cat $F.result
435 else
436 if [ -f $F.result ]; then echo "(Valid)"; fi
437 fi
438
439 # Compare against canonical vcif run
440 if [ -f $F.result -a -f $F.result.canon ]
441 then
442 if cmp $F.result $F.result.canon > /dev/null
443 then
444 true # got the expected result
445 else
446 echo ""
447 echo "--------------------------------------------------------------"
448 echo "WARNING!! This is different from the canonical result!"
449 echo "Check your version of vcif"
450 fi
451 fi
452
453 echo "=============================================================="
454 echo
455 echo "Press ENTER for next test"
456 read foo
457 done
458
459 echo "End of suite"
460 exit
461 ==============================================="
462 # Diplay purpose (with trick for empty file)
463 echo $F
464 if grep "# Purpose" $F
465 then
466