summaryrefslogtreecommitdiffstats
path: root/tcllib/modules/yaml/yaml.test
blob: 40820bd6963a6dda9fa9ec21ce2ae2a97cee420d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
# -*- tcl -*-
# yaml.test:  tests for the yaml library.
#
# Copyright (c) 2008 by KATO Kanryu <kanryu6@users.sourceforge.net>
# All rights reserved.
#


if {[lsearch [namespace children] ::tcltest] == -1} {
    # single test
    set selfrun 1
#    lappend auto_path [pwd]
    set auto_path [linsert $auto_path 0 [pwd]]
    package require tcltest
    namespace import ::tcltest::*
    puts [package require yaml]

} else {
    # all.tcl
    source [file join \
        [file dirname [file dirname [file join [pwd] [info script]]]] \
        devtools testutilities.tcl]

    testsNeedTcl     8.5
    testsNeedTcltest 2

    support {
	use      json/json.tcl json
        useLocal huddle.tcl    huddle
    }
    testing {
        useLocal yaml.tcl yaml
    }
}
proc dictsort2 {dict {pattern d}} {
    set cur  [lindex $pattern 0]
    set subs [lrange $pattern 1 end]
    foreach {tag sw} $cur break
    set out {}
    if {$sw ne ""} {array set msubs $sw}
    if {$tag eq "l"} { ; # list
        set i 0
        foreach {node} $dict {
            set subs1 $subs
            if {$sw ne "" && [info exists msubs($i)]} {
                set subs1 $msubs($i)
            }
            if {$subs1 ne ""} {
                set node [dictsort2 $node $subs1]
            }
            lappend out $node
            incr i
        }
        return $out
    }
    if {$tag eq "d"} { ; # dict
        array set map $dict
        foreach key [lsort [array names map]] {
            set node $map($key)
            set subs1 $subs
            if {$sw ne "" && [info exists msubs($key)]} {
                set subs1 $msubs($key)
            }
            if {$subs1 ne ""} {
                set node [dictsort2 $node $subs1]
            }
            lappend out $key $node
        }
        return $out
    }
    error
}

# ------------

test yaml-21.0.06eef112da {ticket 06eef112da} -body {
    yaml::yaml2dict -file [localPath 06eef112da.data]
} -result {{} {} {alpha 43 beta {houston {{}} newyork {{{} aaa}}}}}

# ------------
# error  .....

test yaml-1.1 "error" -body {
    set error1 {
---
- [name        , \{hr: avg \[\hr: avg\} \] ]
}
    set code [catch {yaml::yaml2dict $error1} msg]
    concat $code $msg
} -result [concat 1 line(3): $yaml::errors(MAPEND_NOT_IN_MAP)]

test yaml-1.2 "error" -body {
    set error2 {
---
- [name        , \[hr: avg \{\hr: avg\] \} ]
}
    set code [catch {yaml::yaml2dict $error2} msg]
    concat $code $msg
} -result [concat 1 line(3): $yaml::errors(SEQEND_NOT_IN_SEQ)]

test yaml-1.3 "error" -body {
    set error3 {
---
- Clark 
- @Brian 
}
    set code [catch {yaml::yaml2dict $error3} msg]
    concat $code $msg
} -result [concat 1 line(4): $yaml::errors(AT_IN_PLAIN)]

test yaml-1.4 "error" -body {
    set error4 {
---
- Clark 
- `Brian 
}
    set code [catch {yaml::yaml2dict $error4} msg]
    concat $code $msg
} -result [concat 1 line(4): $yaml::errors(BT_IN_PLAIN)]

test yaml-1.5 "error" -body {
    set error5 {
---
- Clark 
- 	Brian 
}
    set code [catch {yaml::yaml2dict $error5} msg]
    concat $code $msg
} -result [concat 1 line(4): $yaml::errors(TAB_IN_PLAIN)]

test yaml-1.6 "error" -body {
    set error6 {
---
- *a
- Brian 
- @a Geoge
}
    set code [catch {yaml::yaml2dict $error6} msg]
    concat $code $msg
} -result [concat 1 line(4): $yaml::errors(ANCHOR_NOT_FOUND)]

test yaml-1.7 "error" -body {
    set error7 {
---
- "Clark 
- Brian 
}
    set code [catch {yaml::yaml2dict $error7} msg]
    concat $code $msg
} -result [concat 1 line(3): $yaml::errors(MALFORM_D_QUOTE)]

test yaml-1.8 "error" -body {
    set error8 {
---
- 'Clark 
- Brian 
}
    set code [catch {yaml::yaml2dict $error8} msg]
    concat $code $msg
} -result [concat 1 line(3): $yaml::errors(MALFORM_S_QUOTE)]

test yaml-1.9 "error" -body {
    set error9 {
---
- !!invalidtag Clark 
- Brian 
}
    set code [catch {yaml::yaml2dict $error9} msg]
    concat $code $msg
} -result [concat 1 {line(4): The "!!invalidtag" handle wasn't declared.}]

test yaml-1.10 "error" -body {
    set error10 {
---
- Clark 
<<
  - Brian 
}
    set code [catch {yaml::yaml2dict $error10} msg]
    concat $code $msg
} -result [concat 1 line(5): $yaml::errors(INVALID_MERGE_KEY)]



# -----------
# flow  .....


test yaml-2.1 "flow sequence" -body {
    set inline_seq_seqs {
---
- [name        , hr, avg  ]
- [Mark McGwire, 65, 0.278]
- [Sammy Sosa  , 63, 0.288]
...
- [Sammy Sosa2  , 64, 0.388]
}
    yaml::yaml2dict $inline_seq_seqs
} -result {{name hr avg} {{Mark McGwire} 65 0.278} {{Sammy Sosa} 63 0.288}}

test yaml-2.2 "flow mappings" -body {
    set inline_map_maps {
---
Mark McGwire: {hr: 65, avg: 0.278}
Sammy Sosa: { hr: 63, avg: 0.288}
}
    dictsort2 [yaml::yaml2dict $inline_map_maps] {d d}
} -result [dictsort2 {{Mark McGwire} {hr 65 avg 0.278} {Sammy Sosa} {hr 63 avg 0.288}} {d d}]

test yaml-2.3 "flow mappings" -body {
    set inline_map_maps {
---
? Mark McGwire: {? hr: 65, ? avg: 0.278}
? Sammy Sosa
: {? hr: 63, ? avg: 0.288}
}
    dictsort2 [yaml::yaml2dict $inline_map_maps] {d d}
} -result [dictsort2 {{Mark McGwire} {hr 65 avg 0.278} {Sammy Sosa} {hr 63 avg 0.288}} {d d}]


# ------------------
# block nodes  .....


test yaml-3.2 "Literal Block Scalar" -body {
    set literal {
---
clipped: | # comment
    This has one newline.
  # comment


same as "clipped" above: "This has one newline.\n" # comment

stripped: |- # comment
    This has no newline.



same as "stripped" above: "This has no newline." # comment
kept: |+
    This has four newlines.



same as "kept" above: "This has four newlines.\n\n\n\n"
}
        dictsort2 [yaml::yaml2dict $literal]
} -result [dictsort2 {clipped {This has one newline.
} {same as "clipped" above} {This has one newline.
} stripped {This has no newline.} {same as "stripped" above} {This has no newline.} kept {This has four newlines.



} {same as "kept" above} {This has four newlines.



}}]

test yaml-3.3 "Folding Block Scalar" -body {
    set folding {
---
clipped: >
    This
    has one newline.



same as "clipped" above: "This has one newline.\n" 

stripped: >-
    This
    has
    no newline.



same as "stripped" above: "This has no newline."

kept: >+
    This
    has
    no newline.



same as "kept" above: "This has four newlines.\n\n\n\n"}

    dictsort2 [yaml::yaml2dict $folding]
} -result [dictsort2 {clipped {This has one newline.
} {same as "clipped" above} {This has one newline.
} stripped {This has no newline.} {same as "stripped" above} {This has no newline.} kept {This has no newline.


} {same as "kept" above} {This has four newlines.



}}]

test yaml-3.4 "Folded Block as a Mapping Value" -body {
    set foldedmap {
---
quote: >
    Mark McGwire's
    year was crippled
    by a knee injury.
source: espn
}
    yaml::yaml2dict $foldedmap
} -result [dict create quote {Mark McGwire's year was crippled by a knee injury.
} source espn]

# -----------------------
# Anchor - Aliaces  .....

test yaml-4.1 "Alias Node" -body {
    set alias {
---
- &showell Steve
- Clark 
- Brian 
- Oren 
- *showell 
}
    yaml::yaml2dict $alias
} -result {Steve Clark Brian Oren Steve}

test yaml-4.2 "Alias Node" -body {
    set alias2 {
---
- &hello 
    Meat: pork 
    Starch: potato 
- banana 
- *hello 
}
    yaml::yaml2dict $alias2
} -result [list [dict create Meat pork Starch potato] banana [dict create Meat pork Starch potato]]

test yaml-4.3 "Flow Alias Node" -body {
    set alias3 {
---
- &hello 
    { Meat: &meat pork,
      Starch: potato }
- banana 
- *hello 
- &bye
    [ The last man, children, *meat ]
- habana 
- *bye
}
    dictsort2 [yaml::yaml2dict $alias3] {{l {0 d 2 d}}}
} -result [dictsort2 {{Meat pork Starch potato} banana {Meat pork Starch potato} {{The last man} children pork} habana {{The last man} children pork}} \
{{l {0 d 2 d}}} ]

# -----------------------
# Plane Characters  .....


test yaml-5.1 "Plane Characters" -body {
    set plane_characters {
---
# Outside flow collection:
- ::std::vector
- Up, up and away!
- -123
# Inside flow collection:
- [ ::std::vector,
  "Up, up and away!",
  -123 ]
}
    yaml::yaml2dict $plane_characters
} -result {::std::vector {Up, up and away!} -123 {::std::vector {Up, up and away!} -123}}

test yaml-5.2 "boolean" -body {
    set boolean {
---
india:
    pork   : yes
    beef   : n
    oil    : off
    polytheism : true
arabia:
    pork   : no
    beef   : y
    oil    : on
    polytheism : false
}
    dictsort2 [yaml::yaml2dict $boolean] {d d}
} -result [dictsort2 {india {pork 1 beef 0 oil 0 polytheism 1} arabia {pork 0 beef 1 oil 1 polytheism 0}} {d d}]

if {$::tcl_version < 8.5} {
    test yaml-5.3 "Timestamps" -body {
    set timestamps {
- 2001-12-15T02:59:43.1Z
- 2001-12-14t21:59:43.10-05:00
- 2001-12-14 21:59:43.10 -5
- 2001-12-15 2:59:43.10
- 2002-12-14
}

        yaml::yaml2dict $timestamps
    } -result [list \
            [clock scan "2001-12-15 02:59:43" -gmt 1] \
            [clock scan "+5 hours" -base [clock scan "2001-12-14 21:59:43" -gmt 1]] \
            [clock scan "+5 hours" -base [clock scan "2001-12-14 21:59:43" -gmt 1]] \
            [clock scan "2001-12-15 02:59:43"] \
            [clock scan "2002-12-14"]
        ]
} else {
    test yaml-5.3 "Timestamps" -body {
    set timestamps {
- 2001-12-15T02:59:43.1Z
- 2001-12-14t21:59:43.10-05:00
- 2001-12-14 21:59:43.10 -5
- 2001-12-15 2:59:43.10
- 2002-12-14
}

        yaml::yaml2dict $timestamps
    } -result [list \
            [clock scan "2001-12-15 02:59:43 Z" -format {%Y-%m-%d %k:%M:%S %Z}] \
            [clock scan "2001-12-14 21:59:43 -05:00" -format {%Y-%m-%d %k:%M:%S %Z}] \
            [clock scan "2001-12-14 21:59:43 -05:00" -format {%Y-%m-%d %k:%M:%S %Z}] \
            [clock scan "2001-12-15 02:59:43" -format {%Y-%m-%d %k:%M:%S}] \
            [clock scan "2002-12-14" -format {%Y-%m-%d}]
        ]
}
# {1008385183 1008385183 1008385183 1008352783 1039791600} <- JST

test yaml-5.4 "integer" -body {
    set integers {
- 1
- 1000
- 100,000,000
}
    yaml::yaml2dict $integers
} -result {1 1000 100000000}



# -----------
# block .....

test yaml-6.1 "block sequences" -body {
    set sequences {
---
-
  - Mark McGwire^---
  - Sammy Sosa
-
  - Sammy Sosa
  - Ken Griffey
}

    yaml::yaml2dict $sequences
} -result {{{Mark McGwire^---} {Sammy Sosa}} {{Sammy Sosa} {Ken Griffey}}}

test yaml-6.2 "block mapping" -body {
    set mappings {
---
bill-to:
    given  : Chris
    family : Dumars
hello-to:
    given  : Arnold Berry
    family : Son
}
    yaml::yaml2dict $mappings
} -result [dict create bill-to [dict create given Chris family Dumars] hello-to [dict create given {Arnold Berry} family Son]]

test yaml-6.3 "block mapping, sequence" -body {
    set map_seqs {
---
hr: # 1998 hr ranking
  - Mark McGwire
  - Sammy Sosa
rbi:
  # 1998 rbi ranking
  - Sammy Sosa
  - Ken Griffey
}
    yaml::yaml2dict $map_seqs
} -result [dict create hr {{Mark McGwire} {Sammy Sosa}} rbi {{Sammy Sosa} {Ken Griffey}}]

test yaml-6.4 "block sequence, mapping" -body {
    set seq_maps {
---
-
  name: Mark McGwire
  hr:   65
  avg:  0.278
-
  name: Sammy Sosa
  hr:   63
  avg:  0.288
}
    yaml::yaml2dict $seq_maps
} -result [list [dict create name {Mark McGwire} hr 65 avg 0.278] [dict create name {Sammy Sosa} hr 63 avg 0.288]]

test yaml-6.5 "block mapping, noheader" -body {
    set maps {bar:
 fruit: apple
 name: steve
 sport: baseball
}
    dictsort2 [yaml::yaml2dict $maps] {d d}
} -result [dictsort2 {bar {sport baseball name steve fruit apple}} {d d}]

test yaml-6.6 "block mapping, with empty" -body {
    set maps {foo:
some: value
}
    dictsort2 [yaml::yaml2dict $maps] {d}
} -result [dictsort2 {foo {} some value} {d}]

test yaml-6.7 "block mapping, with empty sequence" -body {
    set maps {foo: []
some: value
}
    dictsort2 [yaml::yaml2dict $maps] {d}
} -result [dictsort2 {foo {} some value} {d}]





# --------------
# options  .....


test yaml-7.1 "load from file" -body {
    set data [yaml::yaml2dict -file [file join [file dirname [info script]] CHANGES]]
    dict get $data title
} -result {YAML parser for Tcl.}

test yaml-7.2 "load from file" -body {
    yaml::setOptions -file
    set data [yaml::yaml2dict [file join [file dirname [info script]] CHANGES]]
    yaml::setOptions -stream
    dict get $data title
} -result {YAML parser for Tcl.}


# -----------------
# flow nodes  .....

test yaml-8.1 "double quote" -body {
    set dquote {
- "1st non-empty,

   2nd non-empty,
   	3rd non-empty"
}
    yaml::yaml2dict $dquote
} -result {{1st non-empty,
2nd non-empty, 3rd non-empty}}


test yaml-8.2 "single quote" -body {
    set squote {
- '1st non-empty,

   2nd ''non-empty'',
   	3rd non-empty'
}

    yaml::yaml2dict $squote
} -result {{1st non-empty,
2nd 'non-empty', 3rd non-empty}}

package require base64
test yaml-9.1 "explicit_tags binary" -body {
    set explicit_tags {
---
not-date: !!str 2002-04-28
picture: !!binary |
 R0lGODlhDAAMAIQAAP//9/X
 17unp5WZmZgAAAOfn515eXv
 Pz7Y6OjuDg4J+fn5OTk6enp
 56enmleECcgggoBADs=

}

    yaml::yaml2dict $explicit_tags
} -result [dict create not-date 2002-04-28 picture [::base64::decode {
R0lGODlhDAAMAIQAAP//9/X
17unp5WZmZgAAAOfn515eXv
Pz7Y6OjuDg4J+fn5OTk6enp
56enmleECcgggoBADs=
}]]

test yaml-9.2 "explicit_tags(inline)" -body {
    set explicit_tags {
---
{not-date: !!str 2002-04-28,
 picture: !!binary
   "R0lGODlhDAAMAIQAAP//9/X
    17unp5WZmZgAAAOfn515eXv
    Pz7Y6OjuDg4J+fn5OTk6enp
    56enmleECcgggoBADs="
}
}

    dictsort2 [yaml::yaml2dict $explicit_tags]
} -result [dictsort2 [list not-date 2002-04-28 picture [::base64::decode {
R0lGODlhDAAMAIQAAP//9/X
17unp5WZmZgAAAOfn515eXv
Pz7Y6OjuDg4J+fn5OTk6enp
56enmleECcgggoBADs=
} ]] ]

test yaml-10.1 "Merge key" -body {
    set merge1 {
---
mapping:
  name: Joe
  job: Accountant
  <<:
    age: 38
}
    dictsort2 [yaml::yaml2dict $merge1] {d d}
} -result [dictsort2 {mapping {name Joe job Accountant age 38}} {d d}]

test yaml-10.2 "Merge key 2" -body {
    set merge2 {
---
- &CENTER { x: 1, y: 2 }
- &LEFT { x: 0, y: 2 }
- &BIG { r: "spaced string" }
- &SMALL { r: 1 }

# All the following maps are equal:

- # Explicit keys
  x: 1
  y: 2
  r: 10
  label: base

- # Merge one map
  << : *CENTER
  r: 10
  label: center

- # Merge multiple maps
  << : [ *CENTER, *BIG ]
  label: center/big

- # Override
  << : [ *BIG, *LEFT, *SMALL ]
  x: 1
  label: big/left/small
}
    yaml::yaml2dict $merge2
} -result [list {x 1 y 2} {x 0 y 2} {r {spaced string}} {r 1} \
            [dict create x 1 y 2 r 10 label base] \
            [dict create x 1 y 2 r 10 label center] \
            [dict create x 1 y 2 r {spaced string} label center/big] \
            [dict create r 1 x 1 y 2 label big/left/small]]

test yaml-11.1 "Invoice" -body {
    set Invoice {
--- # !<tag:clarkevans.com,2002:invoice>
invoice: 34843
date   : 2001-01-23
bill-to: &id001
    given  : Chris
    family : Dumars
    address:
        lines: |
            458 Walkman Dr.
            Suite #292
        city    : Royal Oak
        state   : MI
        postal  : 48046
ship-to: *id001
product:
    - sku         : BL394D
      quantity    : 4
      description : Basketball
      price       : 450.00
    - sku         : BL4438H
      quantity    : 1
      description : Super Hoop
      price       : 2392.00
tax  : 251.42
total: 4443.52
comments:
    Late afternoon is best.
    Backup contact is Nancy
    Billsmer @ 338-4338.
}
    dictsort2 [yaml::yaml2dict $Invoice] {{d {bill-to {{d {address d}}} ship-to {{d {address d}}} product {l d}}}}
} -result [dictsort2 [string map [list TIMESTAMP [clock scan "2001-01-23"]] \
[dict create invoice 34843 date TIMESTAMP bill-to [dict create given Chris family Dumars address [dict create lines {458 Walkman Dr.
Suite #292
} city {Royal Oak} state MI postal 48046]] ship-to [dict create given Chris family Dumars address [dict create lines {458 Walkman Dr.
Suite #292
} city {Royal Oak} state MI postal 48046]] product [list [dict create sku BL394D quantity 4 description Basketball price 450.00] [dict create sku BL4438H quantity 1 description {Super Hoop} price 2392.00]] tax 251.42 total 4443.52 comments {Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.}] ] \
{{d {bill-to {{d {address d}}} ship-to {{d {address d}}} product {l d}}}}]





# --------------
# dumping  .....




test yaml-20.1 "list2yaml" -body {
    set dump1 {
{Mark McGwire} {Sammy Sosa}
}

    yaml::list2yaml $dump1
} -result {---
- Mark McGwire
- Sammy Sosa
}

test yaml-20.2 "dict2yaml" -body {
    set dump2 { name {Sammy Sosa} hr 63 avg 0.288 }
    set _before [eval huddle create $dump2]
    set yaml2 [yaml::dict2yaml $dump2]
    set _after [yaml::yaml2dict $yaml2]
    set _after [eval huddle create $_after]
    huddle equal $_before $_after
} -result {1}

test yaml-20.3 "dict2yaml block/flow scalars" -body {
    set dump_scalars [list \
{http://www.activestate.com/Products/activetcl/} \
{This is the core development home for the tcllib standardized Tcl library. This is a set of pure-Tcl extensions that you can use to become even more productive with Tcl. See also the Tcl Foundry that collects information about many Tcl-related SourceForge projects.} \
{tklib: A library of all-Tcl routines for Tk
tclapps: A set of little apps for Tcl or Tk, to be used as examples, or just for fun
tclbench: A benchmarking suite for Tcl and Tk} ]



    yaml::list2yaml $dump_scalars
} -result {---
- >
  http://www.activestate.com/Products/activetcl/
- >
  This is the core development home for 
  the tcllib standardized Tcl library. 
  This is a set of pure-Tcl extensions 
  that you can use to become even more 
  productive with Tcl. See also the Tcl 
  Foundry that collects information about 
  many Tcl-related SourceForge projects.
- |-
  tklib: A library of all-Tcl routines for Tk
  tclapps: A set of little apps for Tcl or Tk, to be used as examples, or just for fun
  tclbench: A benchmarking suite for Tcl and Tk
}



# ... Tests of addStrings ...
#     (Requires introspection of parser state)


if [info exists selfrun] {
    tcltest::cleanupTests
} else {
    testsuiteCleanup
}