aboutsummaryrefslogtreecommitdiff
path: root/t/19_verbose_always.t
blob: f65f3df22042ad3154297b3fa168218813a403d8 (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
#!/usr/bin/guile -s
!#
; Tests of PyGuile verbosity messages - for full source code coverage
;
; Same tests as 17_verbose.t, except that the verbosity level was set
; to 3 (PYGUILE_VERBOSE_G2P2G_SUCCESSFUL+PYGUILE_VERBOSE_G2P2G_ALWAYS).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (C) 2008 Omer Zak.
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2.1 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public License
; along with this library, in a file named COPYING; if not, write to the
; Free Software Foundation, Inc., 59 Temple Place, Suite 330,
; Boston, MA  02111-1307  USA
;
; For licensing issues, contact <w1@zak.co.il>.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
(use-modules (guiletap))
(use-modules (pyguile))
(use-modules (srfi srfi-13))  ; string-concatenate
(use-modules (ice-9 regex))   ; regexp-substitute

(define thunk-invoke-python-repr
  (lambda (arg . template)
    (lambda ()
      (if (null? template)
	  (python-apply '("__builtin__" "repr") arg '())
	  (python-apply '("__builtin__" "repr") arg '() (car template))))))

(plan 13)

(pyguile-verbosity-set! 3)

(define successful-verbose-3-report
  (string-concatenate
   '("# guile2python: entry: seeking to convert sobj=(\"__builtin__\" \"repr\"); unused stemplate=#<unspecified>\n"
     "# g2p_null2PyNone: unsuccessful conversion: (\"__builtin__\" \"repr\") is not null\n"
     "# DEBUG: g2p_list2List - processing item CAR(sobj)=\"__builtin__\"  CAR(stemp)='guile2python\n"
     "# Entered g2p_apply: sobj=\"__builtin__\"  stemplate='guile2python\n"
     "# guile2python: entry: seeking to convert sobj=\"__builtin__\"; unused stemplate=#<unspecified>\n"
     "# g2p_null2PyNone: unsuccessful conversion: \"__builtin__\" is not null\n"
     "# g2p_list2List: unsuccessful conversion: \"__builtin__\" is not a list\n"
     "# g2p_pair2Tuple: unsuccessful conversion: \"__builtin__\" is not a pair\n"
     "# g2p_bool2Bool: unsuccessful conversion: \"__builtin__\" is not a bool value\n"
     "# g2p_num2Int: unsuccessful conversion: \"__builtin__\" is not a num value\n"
     "# g2p_bignum2Long: unsuccessful conversion: \"__builtin__\" is not a bignum value\n"
     "# g2p_real2Float: unsuccessful conversion: \"__builtin__\" is not a real value\n"
     "# g2p_complex2Complex: unsuccessful conversion: \"__builtin__\" is not a complex value\n"
     "# g2p_string2String: successful conversion of \"__builtin__\" into a Python String value\n"
     "# Leaving g2p_apply: with non-null result\n"
     "# DEBUG: g2p_list2List - processing item CAR(sobj)=\"repr\"  CAR(stemp)='guile2python\n"
     "# Entered g2p_apply: sobj=\"repr\"  stemplate='guile2python\n"
     "# guile2python: entry: seeking to convert sobj=\"repr\"; unused stemplate=#<unspecified>\n"
     "# g2p_null2PyNone: unsuccessful conversion: \"repr\" is not null\n"
     "# g2p_list2List: unsuccessful conversion: \"repr\" is not a list\n"
     "# g2p_pair2Tuple: unsuccessful conversion: \"repr\" is not a pair\n"
     "# g2p_bool2Bool: unsuccessful conversion: \"repr\" is not a bool value\n"
     "# g2p_num2Int: unsuccessful conversion: \"repr\" is not a num value\n"
     "# g2p_bignum2Long: unsuccessful conversion: \"repr\" is not a bignum value\n"
     "# g2p_real2Float: unsuccessful conversion: \"repr\" is not a real value\n"
     "# g2p_complex2Complex: unsuccessful conversion: \"repr\" is not a complex value\n"
     "# g2p_string2String: successful conversion of \"repr\" into a Python String value\n"
     "# Leaving g2p_apply: with non-null result\n"
     "# g2p_list2List: successful conversion of list () by template\n")))

(define expres1
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=(#t)  stemplate=('g2p_list2Tuple 'guile2python)\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=#t  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=#t  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=#t; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: #t is not null\n"
    "# g2p_list2List: unsuccessful conversion: #t is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: #t is not a pair\n"
    "# g2p_bool2Bool: successful conversion of #t into a Python Bool value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"'True'\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"'True'\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"'True'\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"'True'\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"'True'\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"'True'\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"'True'\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"'True'\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"'True'\" into SCM\n")))
(is-ok 1 "Verbosity/3 with a single value"
       expres1
       (with-output-to-string
	 (thunk-invoke-python-repr '(#t))))

(define expres2
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=((() #t #f 1 -5 #\\P (quote symba) 1.0-1.0i 3.125))  stemplate=('g2p_list2Tuple 'guile2python)\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(() #t #f 1 -5 #\\P (quote symba) 1.0-1.0i 3.125)  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=(() #t #f 1 -5 #\\P (quote symba) 1.0-1.0i 3.125)  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=(() #t #f 1 -5 #\\P (quote symba) 1.0-1.0i 3.125); unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: (() #t #f 1 -5 #\\P (quote symba) 1.0-1.0i 3.125) is not null\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=()  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=()  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=(); unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: successful conversion of () into Python None\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=#t  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=#t  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=#t; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: #t is not null\n"
    "# g2p_list2List: unsuccessful conversion: #t is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: #t is not a pair\n"
    "# g2p_bool2Bool: successful conversion of #t into a Python Bool value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=#f  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=#f  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=#f; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: #f is not null\n"
    "# g2p_list2List: unsuccessful conversion: #f is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: #f is not a pair\n"
    "# g2p_bool2Bool: successful conversion of #f into a Python Bool value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=1  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=1  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=1; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: 1 is not null\n"
    "# g2p_list2List: unsuccessful conversion: 1 is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: 1 is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: 1 is not a bool value\n"
    "# g2p_num2Int: successful conversion of 1 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=-5  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=-5  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=-5; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: -5 is not null\n"
    "# g2p_list2List: unsuccessful conversion: -5 is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: -5 is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: -5 is not a bool value\n"
    "# g2p_num2Int: successful conversion of -5 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=#\\P  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=#\\P  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=#\\P; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: #\\P is not null\n"
    "# g2p_list2List: unsuccessful conversion: #\\P is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: #\\P is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: #\\P is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: #\\P is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: #\\P is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: #\\P is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: #\\P is not a complex value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=(quote symba)  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=(quote symba)  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=(quote symba); unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: (quote symba) is not null\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=quote  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=quote  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=quote; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: quote is not null\n"
    "# g2p_list2List: unsuccessful conversion: quote is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: quote is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: quote is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: quote is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: quote is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: quote is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: quote is not a complex value\n"
    "# g2p_string2String: unsuccessful conversion: quote is not a string value\n"
    "# g2p_symbol2String: successful conversion of quote into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=symba  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=symba  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=symba; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: symba is not null\n"
    "# g2p_list2List: unsuccessful conversion: symba is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: symba is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: symba is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: symba is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: symba is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: symba is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: symba is not a complex value\n"
    "# g2p_string2String: unsuccessful conversion: symba is not a string value\n"
    "# g2p_symbol2String: successful conversion of symba into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2List: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=1.0-1.0i  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=1.0-1.0i  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=1.0-1.0i; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: 1.0-1.0i is not null\n"
    "# g2p_list2List: unsuccessful conversion: 1.0-1.0i is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: 1.0-1.0i is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: 1.0-1.0i is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: 1.0-1.0i is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: 1.0-1.0i is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: 1.0-1.0i is not a real value\n"
    "# g2p_complex2Complex: successful conversion of 1.0-1.0i into a Python Complex value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=3.125  CAR(stemp)='guile2python\n"
    "# Entered g2p_apply: sobj=3.125  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=3.125; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: 3.125 is not null\n"
    "# g2p_list2List: unsuccessful conversion: 3.125 is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: 3.125 is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: 3.125 is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: 3.125 is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: 3.125 is not a bignum value\n"
    "# g2p_real2Float: successful conversion of 3.125 into a Python Float value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2List: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"\\\"[None, True, False, 1, -5, 'P', ['quote', 'symba'], (1-1j), 3.125]\\\"\" into SCM\n")))
(is-ok 2 "Verbosity/3 when successful"
       expres2
       (with-output-to-string
	 (thunk-invoke-python-repr '((() #t #f 1 -5 #\P 'symba 1-1i 3.125)))))

(define expres3
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=((() () ()))  stemplate=('g2p_list2Tuple ('g2p_list2Tuple 'g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(() () ())  CAR(stemp)=('g2p_list2Tuple 'g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty)\n"
    "# Entered g2p_apply: sobj=(() () ())  stemplate=('g2p_list2Tuple 'g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty)\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=()  CAR(stemp)='g2p_null2Tuple0\n"
    "# Entered g2p_apply: sobj=()  stemplate='g2p_null2Tuple0\n"
    "# g2p_null2Tuple0: successful conversion of () into Python ()\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=()  CAR(stemp)='g2p_null2List0\n"
    "# Entered g2p_apply: sobj=()  stemplate='g2p_null2List0\n"
    "# g2p_null2List0: successful conversion of () into Python []\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=()  CAR(stemp)='g2p_null2DictEmpty\n"
    "# Entered g2p_apply: sobj=()  stemplate='g2p_null2DictEmpty\n"
    "# g2p_null2DictEmpty: successful conversion of () into Python {}\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"'((), [], {})'\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"'((), [], {})'\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"'((), [], {})'\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"'((), [], {})'\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"'((), [], {})'\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"'((), [], {})'\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"'((), [], {})'\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"'((), [], {})'\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"'((), [], {})'\" into SCM\n")))
(is-ok 3 "g2p* verbosity/3 coverage"
       expres3
       (with-output-to-string
	 (thunk-invoke-python-repr
	  '((() () ()))
	  (list g2p_list2Tuple (list g2p_list2Tuple g2p_null2Tuple0 g2p_null2List0 g2p_null2DictEmpty)))))

(define expres4
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=((1000000 1000000000000))  stemplate=('g2p_list2Tuple ('g2p_list2List ('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int)))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(1000000 1000000000000)  CAR(stemp)=('g2p_list2List ('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int))\n"
    "# Entered g2p_apply: sobj=(1000000 1000000000000)  stemplate=('g2p_list2List ('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int))\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=1000000  CAR(stemp)=('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int)\n"
    "# Entered g2p_apply: sobj=1000000  stemplate=('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int)\n"
    "# Entered g2p_leaf: sobj=1000000  stemplate=('g2p_bignum2Long 'g2p_num2Int)\n"
    "# g2p_leaf: trying another stemplate 'g2p_bignum2Long on sobj\n"
    "# Entered g2p_apply: sobj=1000000  stemplate='g2p_bignum2Long\n"
    "# g2p_bignum2Long: unsuccessful conversion: 1000000 is not a bignum value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_num2Int on sobj\n"
    "# Entered g2p_apply: sobj=1000000  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: successful conversion of 1000000 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_leaf: successful conversion\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=1000000000000  CAR(stemp)=('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int)\n"
    "# Entered g2p_apply: sobj=1000000000000  stemplate=('g2p_leaf 'g2p_bignum2Long 'g2p_num2Int)\n"
    "# Entered g2p_leaf: sobj=1000000000000  stemplate=('g2p_bignum2Long 'g2p_num2Int)\n"
    "# g2p_leaf: trying another stemplate 'g2p_bignum2Long on sobj\n"
    "# Entered g2p_apply: sobj=1000000000000  stemplate='g2p_bignum2Long\n"
    "# g2p_bignum2Long: successful conversion of 1000000000000 into a Python Long value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_leaf: successful conversion\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2List: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"'[1000000, 1000000000000L]'\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"'[1000000, 1000000000000L]'\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"'[1000000, 1000000000000L]'\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"'[1000000, 1000000000000L]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"'[1000000, 1000000000000L]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"'[1000000, 1000000000000L]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"'[1000000, 1000000000000L]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"'[1000000, 1000000000000L]'\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"'[1000000, 1000000000000L]'\" into SCM\n")))
(is-ok 4 "g2p* verbosity/3 coverage - bignums,list2Tuple,list2List"
       expres4
       (with-output-to-string
	 (thunk-invoke-python-repr
	  '((1000000 1000000000000))
	  (list g2p_list2Tuple (list g2p_list2List (list g2p_leaf g2p_bignum2Long g2p_num2Int))))))

(define expres5
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=(((p1at . \"p1bt\") (#:p2al . p2bl)))  stemplate=('g2p_list2Tuple ('g2p_list2Tuple ('g2p_pair2Tuple 'guile2python . 'guile2python) ('g2p_pair2List 'guile2python . 'guile2python)))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=((p1at . \"p1bt\") (#:p2al . p2bl))  CAR(stemp)=('g2p_list2Tuple ('g2p_pair2Tuple 'guile2python . 'guile2python) ('g2p_pair2List 'guile2python . 'guile2python))\n"
    "# Entered g2p_apply: sobj=((p1at . \"p1bt\") (#:p2al . p2bl))  stemplate=('g2p_list2Tuple ('g2p_pair2Tuple 'guile2python . 'guile2python) ('g2p_pair2List 'guile2python . 'guile2python))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(p1at . \"p1bt\")  CAR(stemp)=('g2p_pair2Tuple 'guile2python . 'guile2python)\n"
    "# Entered g2p_apply: sobj=(p1at . \"p1bt\")  stemplate=('g2p_pair2Tuple 'guile2python . 'guile2python)\n"
    "# Entered g2p_apply: sobj=p1at  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=p1at; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: p1at is not null\n"
    "# g2p_list2List: unsuccessful conversion: p1at is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: p1at is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: p1at is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: p1at is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: p1at is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: p1at is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: p1at is not a complex value\n"
    "# g2p_string2String: unsuccessful conversion: p1at is not a string value\n"
    "# g2p_symbol2String: successful conversion of p1at into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=\"p1bt\"  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=\"p1bt\"; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: \"p1bt\" is not null\n"
    "# g2p_list2List: unsuccessful conversion: \"p1bt\" is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: \"p1bt\" is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: \"p1bt\" is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: \"p1bt\" is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: \"p1bt\" is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: \"p1bt\" is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: \"p1bt\" is not a complex value\n"
    "# g2p_string2String: successful conversion of \"p1bt\" into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_pair2Tuple: successful conversion of (p1at . \"p1bt\") into a Python 2-Tuple\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(#:p2al . p2bl)  CAR(stemp)=('g2p_pair2List 'guile2python . 'guile2python)\n"
    "# Entered g2p_apply: sobj=(#:p2al . p2bl)  stemplate=('g2p_pair2List 'guile2python . 'guile2python)\n"
    "# Entered g2p_apply: sobj=#:p2al  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=#:p2al; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: #:p2al is not null\n"
    "# g2p_list2List: unsuccessful conversion: #:p2al is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: #:p2al is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: #:p2al is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: #:p2al is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: #:p2al is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: #:p2al is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: #:p2al is not a complex value\n"
    "# g2p_string2String: unsuccessful conversion: #:p2al is not a string value\n"
    "# g2p_symbol2String: unsuccessful conversion: #:p2al is not a symbol value\n"
    "# g2p_keyword2String: successful conversion of #:p2al into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=p2bl  stemplate='guile2python\n"
    "# guile2python: entry: seeking to convert sobj=p2bl; unused stemplate=#<unspecified>\n"
    "# g2p_null2PyNone: unsuccessful conversion: p2bl is not null\n"
    "# g2p_list2List: unsuccessful conversion: p2bl is not a list\n"
    "# g2p_pair2Tuple: unsuccessful conversion: p2bl is not a pair\n"
    "# g2p_bool2Bool: unsuccessful conversion: p2bl is not a bool value\n"
    "# g2p_num2Int: unsuccessful conversion: p2bl is not a num value\n"
    "# g2p_bignum2Long: unsuccessful conversion: p2bl is not a bignum value\n"
    "# g2p_real2Float: unsuccessful conversion: p2bl is not a real value\n"
    "# g2p_complex2Complex: unsuccessful conversion: p2bl is not a complex value\n"
    "# g2p_string2String: unsuccessful conversion: p2bl is not a string value\n"
    "# g2p_symbol2String: successful conversion of p2bl into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_pair2List: successful conversion of (#:p2al . p2bl) into a Python 2-List\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"\\\"(('p1at', 'p1bt'), ['p2al', 'p2bl'])\\\"\" into SCM\n")))
(is-ok 5 "g2p* verbosity/3 coverage - pair2Tuple,pair2List"
       expres5
       (with-output-to-string
	 (thunk-invoke-python-repr
	  '(((p1at . "p1bt")  (#:p2al . p2bl)))
	  (list g2p_list2Tuple (list g2p_list2Tuple (cons g2p_pair2Tuple (cons guile2python guile2python)) (cons g2p_pair2List (cons guile2python guile2python)))))))

(define substitute-hex-addresses-for-gggggggg
  (lambda (strarg)
    (regexp-substitute/global #f
			      "0x[0-9a-f]{8}"
			      strarg
			      'pre "0xgggggggg" 'post)))

(define expres6
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=(((python-eval <function func at 0xgggggggg> #t) ((1 . \"one\") (2 . \"two\") (3 . \"three\"))))  stemplate=('g2p_list2Tuple ('g2p_list2List 'g2p_opaque2Object ('g2p_alist2Dict ('g2p_num2Int . 'g2p_string2String))))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=((python-eval <function func at 0xgggggggg> #t) ((1 . \"one\") (2 . \"two\") (3 . \"three\")))  CAR(stemp)=('g2p_list2List 'g2p_opaque2Object ('g2p_alist2Dict ('g2p_num2Int . 'g2p_string2String)))\n"
    "# Entered g2p_apply: sobj=((python-eval <function func at 0xgggggggg> #t) ((1 . \"one\") (2 . \"two\") (3 . \"three\")))  stemplate=('g2p_list2List 'g2p_opaque2Object ('g2p_alist2Dict ('g2p_num2Int . 'g2p_string2String)))\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=(python-eval <function func at 0xgggggggg> #t)  CAR(stemp)='g2p_opaque2Object\n"
    "# Entered g2p_apply: sobj=(python-eval <function func at 0xgggggggg> #t)  stemplate='g2p_opaque2Object\n"
    "# g2p_opaque2Object: the Python object inside opaque pysmob (python-eval <function func at 0xgggggggg> #t) is unwrapped\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=((1 . \"one\") (2 . \"two\") (3 . \"three\"))  CAR(stemp)=('g2p_alist2Dict ('g2p_num2Int . 'g2p_string2String))\n"
    "# Entered g2p_apply: sobj=((1 . \"one\") (2 . \"two\") (3 . \"three\"))  stemplate=('g2p_alist2Dict ('g2p_num2Int . 'g2p_string2String))\n"
    "# g2p_alist2Dict sobj=((1 . \"one\") (2 . \"two\") (3 . \"three\"))  stemplate=(('g2p_num2Int . 'g2p_string2String))\n"
    "# Entered g2p_apply: sobj=1  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: successful conversion of 1 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=\"one\"  stemplate='g2p_string2String\n"
    "# g2p_string2String: successful conversion of \"one\" into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=2  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: successful conversion of 2 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=\"two\"  stemplate='g2p_string2String\n"
    "# g2p_string2String: successful conversion of \"two\" into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=3  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: successful conversion of 3 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# Entered g2p_apply: sobj=\"three\"  stemplate='g2p_string2String\n"
    "# g2p_string2String: successful conversion of \"three\" into a Python String value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_alist2Dict: successful conversion\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2List: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"\\\"[<function func at 0xgggggggg>, {1: 'one', 2: 'two', 3: 'three'}]\\\"\" into SCM\n")))
(python-eval "def func(a):\n  print a\n" #f)
(define opaqueobj (python-eval "func" #t))
(define run-test-opaque
  (lambda ()
    (with-output-to-string
      (thunk-invoke-python-repr
       (list (list opaqueobj '((1 . "one")(2 . "two")(3 . "three"))))
       (list g2p_list2Tuple (list g2p_list2List g2p_opaque2Object (cons g2p_alist2Dict (list (cons g2p_num2Int g2p_string2String)))))))))
(is-ok 6 "g2p* verbosity/3 coverage - opaque2Object,g2p_alist2Dict"
       expres6
       (substitute-hex-addresses-for-gggggggg
	(run-test-opaque)))

; Additional tests

(define expres7
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=((#t 5))  stemplate=('g2p_list2Tuple ('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(#t 5)  CAR(stemp)=('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool))\n"
    "# Entered g2p_apply: sobj=(#t 5)  stemplate=('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool))\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=#t  CAR(stemp)=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_apply: sobj=#t  stemplate=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_leaf: sobj=#t  stemplate=('g2p_num2Int 'g2p_bool2Bool)\n"
    "# g2p_leaf: trying another stemplate 'g2p_num2Int on sobj\n"
    "# Entered g2p_apply: sobj=#t  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: unsuccessful conversion: #t is not a num value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_bool2Bool on sobj\n"
    "# Entered g2p_apply: sobj=#t  stemplate='g2p_bool2Bool\n"
    "# g2p_bool2Bool: successful conversion of #t into a Python Bool value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_leaf: successful conversion\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=5  CAR(stemp)=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_apply: sobj=5  stemplate=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_leaf: sobj=5  stemplate=('g2p_num2Int 'g2p_bool2Bool)\n"
    "# g2p_leaf: trying another stemplate 'g2p_num2Int on sobj\n"
    "# Entered g2p_apply: sobj=5  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: successful conversion of 5 into a Python Int value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_leaf: successful conversion\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2List: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"'[True, 5]'\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"'[True, 5]'\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"'[True, 5]'\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"'[True, 5]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"'[True, 5]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"'[True, 5]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"'[True, 5]'\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"'[True, 5]'\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"'[True, 5]'\" into SCM\n")))
(is-ok 7 "g2p_leaf verbosity/3 coverage - all values recognized by leaf"
       expres7
       (with-output-to-string
	 (thunk-invoke-python-repr
	  '((#t 5 ))
	  (list g2p_list2Tuple (list g2p_list2List (list g2p_leaf g2p_num2Int g2p_bool2Bool))))))

; Run thunk-invoke-python-repr under catch harness.
(define catch-thunk-invoke-python-repr
  (lambda (arg . template)
    (lambda ()
      (catch
       #t
       (lambda ()
	 (if (null? template)
	     (python-apply '("__builtin__" "repr") arg '())
	     (python-apply '("__builtin__" "repr") arg '() (car template))))
       (lambda (key . args2) (object->string (list key args2)))))))

(define expres8
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=((3.1 5))  stemplate=('g2p_list2Tuple ('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(3.1 5)  CAR(stemp)=('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool))\n"
    "# Entered g2p_apply: sobj=(3.1 5)  stemplate=('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool))\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=3.1  CAR(stemp)=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_apply: sobj=3.1  stemplate=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_leaf: sobj=3.1  stemplate=('g2p_num2Int 'g2p_bool2Bool)\n"
    "# g2p_leaf: trying another stemplate 'g2p_num2Int on sobj\n"
    "# Entered g2p_apply: sobj=3.1  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: unsuccessful conversion: 3.1 is not a num value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_bool2Bool on sobj\n"
    "# Entered g2p_apply: sobj=3.1  stemplate='g2p_bool2Bool\n"
    "# g2p_bool2Bool: unsuccessful conversion: 3.1 is not a bool value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: unsuccessful conversion, no stemplate fit the sobj\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_list2List: unsuccessful conversion of element 0: 3.1 does not match personalized template\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_list2Tuple: unsuccessful conversion of element 0: (3.1 5) does not match personalized template\n"
    "# Leaving g2p_apply: with null result\n")))
(is-ok 8 "g2p_leaf verbosity/3 coverage - first value not recognized by leaf"
       expres8
       (with-output-to-string
	 (catch-thunk-invoke-python-repr
	  '((3.1 5))
	  (list g2p_list2Tuple (list g2p_list2List (list g2p_leaf g2p_num2Int g2p_bool2Bool))))))

(define expres9
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=((#t \"string\"))  stemplate=('g2p_list2Tuple ('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=(#t \"string\")  CAR(stemp)=('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool))\n"
    "# Entered g2p_apply: sobj=(#t \"string\")  stemplate=('g2p_list2List ('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool))\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=#t  CAR(stemp)=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_apply: sobj=#t  stemplate=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_leaf: sobj=#t  stemplate=('g2p_num2Int 'g2p_bool2Bool)\n"
    "# g2p_leaf: trying another stemplate 'g2p_num2Int on sobj\n"
    "# Entered g2p_apply: sobj=#t  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: unsuccessful conversion: #t is not a num value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_bool2Bool on sobj\n"
    "# Entered g2p_apply: sobj=#t  stemplate='g2p_bool2Bool\n"
    "# g2p_bool2Bool: successful conversion of #t into a Python Bool value\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_leaf: successful conversion\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# DEBUG: g2p_list2List - processing item CAR(sobj)=\"string\"  CAR(stemp)=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate=('g2p_leaf 'g2p_num2Int 'g2p_bool2Bool)\n"
    "# Entered g2p_leaf: sobj=\"string\"  stemplate=('g2p_num2Int 'g2p_bool2Bool)\n"
    "# g2p_leaf: trying another stemplate 'g2p_num2Int on sobj\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate='g2p_num2Int\n"
    "# g2p_num2Int: unsuccessful conversion: \"string\" is not a num value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_bool2Bool on sobj\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate='g2p_bool2Bool\n"
    "# g2p_bool2Bool: unsuccessful conversion: \"string\" is not a bool value\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: unsuccessful conversion, no stemplate fit the sobj\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_list2List: unsuccessful conversion of element 1: \"string\" does not match personalized template\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_list2Tuple: unsuccessful conversion of element 0: (#t \"string\") does not match personalized template\n"
    "# Leaving g2p_apply: with null result\n")))
(is-ok 9 "g2p_leaf verbosity/3 coverage - last value not recognized by leaf"
       expres9
       (with-output-to-string
	 (catch-thunk-invoke-python-repr
	  '((#t "string"))
	  (list g2p_list2Tuple (list g2p_list2List (list g2p_leaf g2p_num2Int g2p_bool2Bool))))))

(define saved-verbosity (pyguile-verbosity-set! 0))

(define catch-test-apply
  (lambda (func args kws . targ)
    (catch #t
	   (lambda () (python-apply func args kws (car targ)))
	   (lambda (key . args2) (object->string (list key args2))))))

(is-ok 10 "g2p_null2* validate test - non-null values"
       "(misc-error (\"python-apply\" \"positional arguments conversion failure (~S)\" ((\"string\")) #f))"
       (catch-test-apply '("__builtin__" "repr") '("string") '()
			 (list g2p_list2Tuple (list g2p_leaf g2p_null2Tuple0 g2p_null2List0 g2p_null2DictEmpty))))

(pyguile-verbosity-set! saved-verbosity)

(define expres11
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=(\"string\")  stemplate=('g2p_list2Tuple ('g2p_leaf 'g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=\"string\"  CAR(stemp)=('g2p_leaf 'g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty)\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate=('g2p_leaf 'g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty)\n"
    "# Entered g2p_leaf: sobj=\"string\"  stemplate=('g2p_null2Tuple0 'g2p_null2List0 'g2p_null2DictEmpty)\n"
    "# g2p_leaf: trying another stemplate 'g2p_null2Tuple0 on sobj\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate='g2p_null2Tuple0\n"
    "# g2p_null2Tuple0: unsuccessful conversion: \"string\" is not null\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_null2List0 on sobj\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate='g2p_null2List0\n"
    "# g2p_null2List0: unsuccessful conversion: \"string\" is not null\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: trying another stemplate 'g2p_null2DictEmpty on sobj\n"
    "# Entered g2p_apply: sobj=\"string\"  stemplate='g2p_null2DictEmpty\n"
    "# g2p_null2DictEmpty: unsuccessful conversion: \"string\" is not null\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_leaf: unsuccessful conversion, no stemplate fit the sobj\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_list2Tuple: unsuccessful conversion of element 0: \"string\" does not match personalized template\n"
    "# Leaving g2p_apply: with null result\n")))
(is-ok 11 "g2p_null2* verbosity/3 coverage - non-null values"
       expres11
       (with-output-to-string
	 (catch-thunk-invoke-python-repr
	  '("string")
	  (list g2p_list2Tuple (list g2p_leaf g2p_null2Tuple0 g2p_null2List0 g2p_null2DictEmpty)))))


(define expres12
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=(())  stemplate=('g2p_list2Tuple ('g2p_leaf . 'g2p_null2Tuple0))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=()  CAR(stemp)=('g2p_leaf . 'g2p_null2Tuple0)\n"
    "# Entered g2p_apply: sobj=()  stemplate=('g2p_leaf . 'g2p_null2Tuple0)\n"
    "# Entered g2p_leaf: sobj=()  stemplate='g2p_null2Tuple0\n"
    "# g2p_null2Tuple0: successful conversion of () into Python ()\n"
    "# Leaving g2p_leaf, after G2P_SMOBP conversion, with non-null result\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# g2p_list2Tuple: successful conversion of list () by template\n"
    "# Leaving g2p_apply: with non-null result\n"
    "# guileassoc2pythondict: entry: seeking to convert sobj=() using stemplate=#<undefined>\n"
    "# guileassoc2pythondict: successful conversion of ()\n"
    "# p2g_apply: pobj=\"'()'\"  smob-stemplate='python2guile\n"
    "# python2guile: trying to convert pobj=\"'()'\"  using stemplate=#<unspecified>\n"
    "# p2g_None2SCM_EOL: pobj=\"'()'\" stemplate=#<unspecified>\n"
    "# p2g_Bool2SCM_BOOL: failed to convert pobj=\"'()'\"  using stemplate=#<unspecified>\n"
    "# p2g_Int2num: failed to convert pobj=\"'()'\"  using stemplate=#<unspecified>\n"
    "# p2g_Long2bignum: failed to convert pobj=\"'()'\"  using stemplate=#<unspecified>\n"
    "# p2g_Float2real: failed to convert pobj=\"'()'\"  using stemplate=#<unspecified>\n"
    "# p2g_Complex2complex: failed to convert pobj=\"'()'\"  using stemplate=#<unspecified>\n"
    "# p2g_String2string: successful conversion of \"'()'\" into SCM\n")))
(is-ok 12 "g2p_leaf verbosity/3 coverage - G2P_SMOB, successful"
       expres12
       (with-output-to-string
	 (catch-thunk-invoke-python-repr
	  '(())
	  (list g2p_list2Tuple (cons g2p_leaf g2p_null2Tuple0)))))

(define expres13
  (string-concatenate
   (list
    successful-verbose-3-report
    "# Entered g2p_apply: sobj=(#t)  stemplate=('g2p_list2Tuple ('g2p_leaf . 'g2p_null2Tuple0))\n"
    "# g2p_list2Tuple - processing item CAR(sobj)=#t  CAR(stemp)=('g2p_leaf . 'g2p_null2Tuple0)\n"
    "# Entered g2p_apply: sobj=#t  stemplate=('g2p_leaf . 'g2p_null2Tuple0)\n"
    "# Entered g2p_leaf: sobj=#t  stemplate='g2p_null2Tuple0\n"
    "# g2p_null2Tuple0: unsuccessful conversion: #t is not null\n"
    "# Leaving g2p_leaf, after G2P_SMOBP conversion, with null result\n"
    "# Leaving g2p_apply: with null result\n"
    "# g2p_list2Tuple: unsuccessful conversion of element 0: #t does not match personalized template\n"
    "# Leaving g2p_apply: with null result\n")))
(is-ok 13 "g2p_leaf verbosity/3 coverage - G2P_SMOB, failed"
       expres13
       (with-output-to-string
	 (catch-thunk-invoke-python-repr
	  '(#t)
	  (list g2p_list2Tuple (cons g2p_leaf g2p_null2Tuple0)))))

; End of 19_verbose_always.t