-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathengineTest.sql
More file actions
1720 lines (1711 loc) · 91.8 KB
/
Copy pathengineTest.sql
File metadata and controls
1720 lines (1711 loc) · 91.8 KB
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
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
------------------------------------------------------------------------------
-- PostgreSQL Table Tranlation Engine - Test file
-- Version 0.1 for PostgreSQL 9.x
-- https://github.com/CASFRI/postTranslationEngine
--
-- This is free software; you can redistribute and/or modify it under
-- the terms of the GNU General Public Licence. See the COPYING file.
--
-- Copyright (C) 2018-2020 Pierre Racine <pierre.racine@sbf.ulaval.ca>,
-- Marc Edwards <medwards219@gmail.com>,
-- Pierre Vernier <pierre.vernier@gmail.com>
-------------------------------------------------------------------------------
SET lc_messages TO 'en_US.UTF-8';
SET tt.debug TO TRUE;
SET tt.debug TO FALSE;
-- Create a test source table
DROP TABLE IF EXISTS test_sourcetable1;
CREATE TABLE test_sourcetable1 AS
SELECT 'a'::text id, 1 crown_closure
UNION ALL
SELECT 'b'::text, 3
UNION ALL
SELECT 'c'::text, 101;
-- Create a test translation table
DROP TABLE IF EXISTS test_translationtable;
CREATE TABLE test_translationtable AS
SELECT '1' rule_id,
'CROWN_CLOSURE_UPPER'::text target_attribute,
'integer'::text target_attribute_type,
'notNull(crown_closure|-8888);isbetween(crown_closure, ''0'', ''100''|-9999)'::text validation_rules,
'copyInt(crown_closure)'::text translation_rules,
'Test'::text description,
'TRUE' desc_uptodate_with_rules
UNION ALL
SELECT '2' rule_id,
'CROWN_CLOSURE_LOWER'::text target_attribute,
'integer'::text target_attribute_type,
'notNull(crown_closure|-8888);isbetween(crown_closure, ''0'', ''100''|-9999)'::text validation_rules,
'copyInt(crown_closure)'::text translation_rules,
'Test'::text description,
'TRUE' desc_uptodate_with_rules;
DROP TABLE IF EXISTS test_translationtable2;
CREATE TABLE test_translationtable2 AS
SELECT '1' rule_id,
'CROWN CLOSURE UPPER'::text target_attribute,
'integer'::text target_attribute_type,
'notNull(crown_closure|-8888);isbetween(crown_closure, ''0'', ''100''|-9999)'::text validation_rules,
'copyInt(crown_closure)'::text translation_rules,
'Test'::text description,
'TRUE' desc_uptodate_with_rules;
DROP TABLE IF EXISTS test_translationtable3;
CREATE TABLE test_translationtable3 AS
SELECT '1' rule_id,
'CROWN_CLOSURE_UPPER'::text target_attribute,
'integer'::text target_attribute_type,
'notNull(crown_closure|);isbetween(crown_closure, ''0'', ''100''|-9999)'::text validation_rules,
'copyInt(crown_closure)'::text translation_rules,
'Test'::text description,
'TRUE' desc_uptodate_with_rules;
DROP TABLE IF EXISTS test_translationtable4;
CREATE TABLE test_translationtable4 AS
SELECT '1' rule_id,
'CROWN_CLOSURE_UPPER'::text target_attribute,
'integer'::text target_attribute_type,
'notNull(crown_closure|-3333);isbetween(crown_closure, ''0'', ''100''|-9999)'::text validation_rules,
'copyInt(crown_closure|WRONG_TYPE)'::text translation_rules,
'Test'::text description,
'TRUE' desc_uptodate_with_rules;
--SELECT TT_PrepareWithLogging('public', 'test_translationtable', '_with_logging');
SELECT TT_Prepare('public', 'test_translationtable', '_without_logging');
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Comment out the following line and the last one of the file to display
-- only failing tests
SELECT * FROM (
-----------------------------------------------------------
-- The first table in the next WITH statement list all the function tested
-- with the number of test for each. It must be adjusted for every new test.
-- It is required to list tests which would not appear because they failed
-- by returning nothing.
WITH test_nb AS (
SELECT 'TT_FullTableName'::text function_tested, 1 maj_num, 5 nb_test UNION ALL
SELECT 'TT_FullFunctionName'::text, 2, 5 UNION ALL
SELECT 'TT_ParseArgs'::text, 3, 12 UNION ALL
SELECT 'TT_ParseRules'::text, 4, 8 UNION ALL
SELECT 'TT_ValidateTTable'::text, 5, 7 UNION ALL
SELECT 'TT_TextFctExists'::text, 6, 3 UNION ALL
--SELECT 'TT_PrepareWithLogging'::text, 7, 8 UNION ALL
SELECT 'TT_TextFctReturnType'::text, 8, 1 UNION ALL
SELECT 'TT_TextFctEval'::text, 9, 15 UNION ALL
SELECT 'TT_ParseStringList'::text, 10, 36 UNION ALL
SELECT 'TT_RepackStringList'::text, 11, 74 UNION ALL
SELECT 'TT_IsCastableTo'::text, 12, 2 UNION ALL
SELECT 'TT_RuleToSQL'::text, 13, 8 UNION ALL
SELECT 'TT_Prepare'::text, 14, 8 UNION ALL
SELECT 'TT_ReplaceAroundChars'::text, 15, 19 UNION ALL
SELECT 'TT_PrepareFctCalls'::text, 16, 9 UNION ALL
SELECT 'TT_ParseJoinFctCall'::text, 17, 16 UNION ALL
SELECT 'TT_BuildJoinExpr'::text, 18, 14
),
test_series AS (
-- Build a table of function names with a sequence of number for each function to be tested
SELECT function_tested, maj_num, nb_test, generate_series(1, nb_test)::text min_num
FROM test_nb
ORDER BY maj_num, min_num
)
SELECT coalesce(maj_num || '.' || min_num, b.number) AS number,
coalesce(a.function_tested, 'ERROR: Insufficient number of tests for ' ||
b.function_tested || ' in the initial table...') AS function_tested,
coalesce(description, 'ERROR: Too many tests (' || nb_test || ') for ' || a.function_tested || ' in the initial table...') AS description,
NOT passed IS NULL AND
(regexp_split_to_array(number, '\.'))[1] = maj_num::text AND
(regexp_split_to_array(number, '\.'))[2] = min_num AND passed AS passed
FROM test_series AS a FULL OUTER JOIN (
---------------------------------------------------------
---------------------------------------------------------
-- Test 1 - TT_FullTableName
---------------------------------------------------------
SELECT '1.1'::text number,
'TT_FullTableName'::text function_tested,
'Basic test'::text description,
TT_FullTableName('public', 'test') = 'public.test' passed
---------------------------------------------------------
UNION ALL
SELECT '1.2'::text number,
'TT_FullTableName'::text function_tested,
'Null schema'::text description,
TT_FullTableName(NULL, 'test') = 'public.test' passed
---------------------------------------------------------
UNION ALL
SELECT '1.3'::text number,
'TT_FullTableName'::text function_tested,
'Both NULL parameters'::text description,
TT_FullTableName(NULL, NULL) IS NULL passed
---------------------------------------------------------
UNION ALL
SELECT '1.4'::text number,
'TT_FullTableName'::text function_tested,
'Table name starting with a digit'::text description,
TT_FullTableName(NULL, '1table') = 'public."1table"' passed
---------------------------------------------------------
UNION ALL
SELECT '1.5'::text number,
'TT_FullTableName'::text function_tested,
'Both names starting with a digit'::text description,
TT_FullTableName('1schema', '1table') = '"1schema"."1table"' passed
---------------------------------------------------------
-- Test 2 - TT_FullFunctionName
---------------------------------------------------------
UNION ALL
SELECT '2.1'::text number,
'TT_FullFunctionName'::text function_tested,
'Basic test'::text description,
TT_FullFunctionName('public', 'test') = 'tt_test' passed
---------------------------------------------------------
UNION ALL
SELECT '2.2'::text number,
'TT_FullFunctionName'::text function_tested,
'Null schema'::text description,
TT_FullFunctionName(NULL, 'test') = 'tt_test' passed
---------------------------------------------------------
UNION ALL
SELECT '2.3'::text number,
'TT_FullFunctionName'::text function_tested,
'Both NULL parameters'::text description,
TT_FullFunctionName(NULL, NULL) IS NULL passed
---------------------------------------------------------
UNION ALL
SELECT '2.4'::text number,
'TT_FullFunctionName'::text function_tested,
'Table name starting with a digit'::text description,
TT_FullFunctionName(NULL, '1function') = 'tt_1function' passed
---------------------------------------------------------
UNION ALL
SELECT '2.5'::text number,
'TT_FullFunctionName'::text function_tested,
'Both names starting with a digit'::text description,
TT_FullFunctionName('1schema', '1function') = '1schema.tt_1function' passed
---------------------------------------------------------
-- Test 3 - TT_ParseArgs
---------------------------------------------------------
UNION ALL
SELECT '3.1'::text number,
'TT_ParseArgs'::text function_tested,
'Basic test, space and numeric'::text description,
TT_ParseArgs('aa, bb, ''-111.11''') = ARRAY['aa', 'bb', '''-111.11'''] passed
---------------------------------------------------------
UNION ALL
SELECT '3.2'::text number,
'TT_ParseArgs'::text function_tested,
'Test NULL'::text description,
TT_ParseArgs() IS NULL passed
---------------------------------------------------------
UNION ALL
SELECT '3.3'::text number,
'TT_ParseArgs'::text function_tested,
'Test empty strings'::text description,
TT_ParseArgs(''''',""') = ARRAY['''''', '""'] passed
---------------------------------------------------------
UNION ALL
SELECT '3.4'::text number,
'TT_ParseArgs'::text function_tested,
'Test string containing a comma'::text description,
TT_ParseArgs('''a,a''') = ARRAY['''a,a'''] passed
---------------------------------------------------------
UNION ALL
SELECT '3.5'::text number,
'TT_ParseArgs'::text function_tested,
'Test value containing escaped single quote'::text description,
TT_ParseArgs('''a\''a''') = ARRAY['''a\''a'''] passed
---------------------------------------------------------
UNION ALL
SELECT '3.6'::text number,
'TT_ParseArgs'::text function_tested,
'Test column with _ and -'::text description,
TT_ParseArgs('column_A, column-B') = ARRAY['column_A', 'column-B'] passed
---------------------------------------------------------
UNION ALL
SELECT '3.7'::text number,
'TT_ParseArgs'::text function_tested,
'Test strings with special chars'::text description,
TT_ParseArgs('''str /:ng 1'', ''str -- ing2''') = ARRAY['''str /:ng 1''', '''str -- ing2'''] passed
---------------------------------------------------------
UNION ALL
SELECT '3.8'::text number,
'TT_ParseArgs'::text function_tested,
'Test stringLists with string'::text description,
TT_ParseArgs('{''string 1'', ''string,2''}') = ARRAY['{''string 1'', ''string,2''}'] passed
---------------------------------------------------------
UNION ALL
SELECT '3.9'::text number,
'TT_ParseArgs'::text function_tested,
'Test stringList of colnames'::text description,
TT_ParseArgs('{cola, col_b}') = ARRAY['{cola, col_b}']
---------------------------------------------------------
UNION ALL
SELECT '3.10'::text number,
'TT_ParseArgs'::text function_tested,
'Test mixed stringList'::text description,
TT_ParseArgs('{cola, ''string 1''}') = ARRAY['{cola, ''string 1''}'] passed
---------------------------------------------------------
UNION ALL
SELECT '3.11'::text number,
'TT_ParseArgs'::text function_tested,
'Test two stringLists and strings and col names'::text description,
TT_ParseArgs('col_a, {col_b, ''str1''}, {''str2'', colC}, ''str 3''') = ARRAY['col_a', '{col_b, ''str1''}', '{''str2'', colC}', '''str 3'''] passed
---------------------------------------------------------
UNION ALL
SELECT '3.12'::text number,
'TT_ParseArgs'::text function_tested,
'Basic test, space and unquoted numeric'::text description,
TT_ParseArgs('aa, bb, -111.11') = ARRAY['aa', 'bb', '-111.11'] passed
---------------------------------------------------------
-- Test 4 - TT_ParseRules
---------------------------------------------------------
UNION ALL
SELECT '4.1'::text number,
'TT_ParseRules'::text function_tested,
'Basic test, space and numeric'::text description,
TT_ParseRules_old('test1(aa, bb,''-999.55''); test2(cc, dd,''222.22'')') = ARRAY[('test1', '{aa,bb,''-999.55''}', 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old, ('test2', '{cc,dd,''222.22''}', 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old]::TT_RuleDef_old[] passed
---------------------------------------------------------
UNION ALL
SELECT '4.2'::text number,
'TT_ParseRules'::text function_tested,
'Test NULL'::text description,
TT_ParseRules_old() IS NULL passed
---------------------------------------------------------
UNION ALL
SELECT '4.3'::text number,
'TT_ParseRules'::text function_tested,
'Test empty'::text description,
TT_ParseRules_old('') IS NULL passed
---------------------------------------------------------
UNION ALL
SELECT '4.4'::text number,
'TT_ParseRules'::text function_tested,
'Test empty function'::text description,
TT_ParseRules_old('test1()') = ARRAY[('test1', NULL, 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old]::TT_RuleDef_old[] passed
---------------------------------------------------------
UNION ALL
SELECT '4.5'::text number,
'TT_ParseRules'::text function_tested,
'Test many empty functions'::text description,
TT_ParseRules_old('test1(); test2(); test3()') = ARRAY[('test1', NULL, 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old, ('test2', NULL, 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old, ('test3', NULL, 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old]::TT_RuleDef_old[] passed
---------------------------------------------------------
UNION ALL
SELECT '4.6'::text number,
'TT_ParseRules'::text function_tested,
'Test quoted arguments'::text description,
TT_ParseRules_old('test1(''aa'', ''bb'')') = ARRAY[('test1', '{''aa'',''bb''}', 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old]::TT_RuleDef_old[] passed
---------------------------------------------------------
UNION ALL
SELECT '4.7'::text number,
'TT_ParseRules'::text function_tested,
'Test quoted arguments containing comma and special chars'::text description,
TT_ParseRules_old('test1(''a,a'', ''b@b'')') = ARRAY[('test1', '{"''a,a''",''b@b''}', 'NO_DEFAULT_ERROR_CODE', FALSE)::TT_RuleDef_old]::TT_RuleDef_old[] passed
---------------------------------------------------------
UNION ALL
SELECT '4.8'::text number,
'TT_ParseRules'::text function_tested,
'Test what''s in the test translation table'::text description,
array_agg(TT_ParseRules_old(validation_rules)) = ARRAY[ARRAY[('notNull', '{crown_closure}', -8888, FALSE)::TT_RuleDef_old, ('isbetween', '{crown_closure, ''0'', ''100''}', -9999, FALSE)::TT_RuleDef_old]::TT_RuleDef_old[], ARRAY[('notNull', '{crown_closure}', -8888, FALSE)::TT_RuleDef_old, ('isbetween', '{crown_closure, ''0'', ''100''}', -9999, FALSE)::TT_RuleDef_old]::TT_RuleDef_old[]] passed
FROM public.test_translationtable
---------------------------------------------------------
-- Test 5 - TT_ValidateTTable
--------------------------------------------------------
UNION ALL
SELECT '5.1'::text number,
'TT_ValidateTTable'::text function_tested,
'Basic test'::text description,
array_agg(rec)::text =
'{"(CROWN_CLOSURE_UPPER,integer,\"{\"\"(notNull,{crown_closure},-8888,f)\"\",\"\"(isbetween,\\\\\"\"{crown_closure,''0'',''100''}\\\\\"\",-9999,f)\"\"}\",\"(copyInt,{crown_closure},-3333,f)\")","(CROWN_CLOSURE_LOWER,integer,\"{\"\"(notNull,{crown_closure},-8888,f)\"\",\"\"(isbetween,\\\\\"\"{crown_closure,''0'',''100''}\\\\\"\",-9999,f)\"\"}\",\"(copyInt,{crown_closure},-3333,f)\")"}' passed
FROM (SELECT TT_ValidateTTable_old('public', 'test_translationtable') rec) foo
--------------------------------------------------------
UNION ALL
SELECT '5.2'::text number,
'TT_ValidateTTable'::text function_tested,
'Test for NULL'::text description,
array_agg(rec)::text IS NULL passed
FROM (SELECT TT_ValidateTTable_old(NULL) rec) foo
--------------------------------------------------------
UNION ALL
SELECT '5.3'::text number,
'TT_ValidateTTable'::text function_tested,
'Test for empties'::text description,
array_agg(rec)::text IS NULL passed
FROM (SELECT TT_ValidateTTable_old('', '') rec) foo
--------------------------------------------------------
UNION ALL
SELECT '5.4'::text number,
'TT_ValidateTTable'::text function_tested,
'Test default schema to public'::text description,
array_agg(rec)::text =
'{"(CROWN_CLOSURE_UPPER,integer,\"{\"\"(notNull,{crown_closure},-8888,f)\"\",\"\"(isbetween,\\\\\"\"{crown_closure,''0'',''100''}\\\\\"\",-9999,f)\"\"}\",\"(copyInt,{crown_closure},-3333,f)\")","(CROWN_CLOSURE_LOWER,integer,\"{\"\"(notNull,{crown_closure},-8888,f)\"\",\"\"(isbetween,\\\\\"\"{crown_closure,''0'',''100''}\\\\\"\",-9999,f)\"\"}\",\"(copyInt,{crown_closure},-3333,f)\")"}' passed
FROM (SELECT TT_ValidateTTable_old('test_translationtable') rec) foo
--------------------------------------------------------
UNION ALL
SELECT '5.5'::text number,
'TT_ValidateTTable'::text function_tested,
'Invalid target attribute name'::text description,
TT_IsError('SELECT TT_ValidateTTable_old(''public'', ''test_translationtable2''::text);') =
'ERROR IN TRANSLATION TABLE AT RULE_ID # 1: Target attribute name (CROWN CLOSURE UPPER) is invalid...' passed
--------------------------------------------------------
UNION ALL
SELECT '5.6'::text number,
'TT_ValidateTTable'::text function_tested,
'Test wrong translation error type'::text description,
TT_IsError('SELECT TT_ValidateTTable_old(''public'', ''test_translationtable4''::text);')
= 'ERROR IN TRANSLATION TABLE AT RULE_ID # 1 (CROWN_CLOSURE_UPPER): Error code (WRONG_TYPE) cannot be cast to the target attribute type (integer) for translation rule ''copyInt()''...' passed
--------------------------------------------------------
UNION ALL
SELECT '5.7'::text number,
'TT_ValidateTTable'::text function_tested,
'Test NULL validation error type'::text description,
array_agg(rec)::text =
'{"(CROWN_CLOSURE_UPPER,integer,\"{\"\"(notNull,{crown_closure},-8888,f)\"\",\"\"(isbetween,\\\\\"\"{crown_closure,''0'',''100''}\\\\\"\",-9999,f)\"\"}\",\"(copyInt,{crown_closure},-3333,f)\")"}' passed
FROM (SELECT TT_ValidateTTable_old('public', 'test_translationtable3'::text) rec) foo
--------------------------------------------------------
-- Test 6 - TT_TextFctExists
--------------------------------------------------------
UNION ALL
SELECT '6.1'::text number,
'TT_TextFctExists'::text function_tested,
'Test two NULLs'::text description,
TT_TextFctExists(NULL, NULL) IS FALSE passed
--------------------------------------------------------
UNION ALL
SELECT '6.2'::text number,
'TT_TextFctExists'::text function_tested,
'Test one empty'::text description,
TT_TextFctExists('', NULL) = FALSE passed
--------------------------------------------------------
UNION ALL
SELECT '6.3'::text number,
'TT_TextFctExists'::text function_tested,
'Basic test'::text description,
TT_TextFctExists('isbetween', '3') passed
/*
--------------------------------------------------------
-- Test 7 - TT_PrepareWithLogging
--------------------------------------------------------
UNION ALL
SELECT '7.1'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Basic test, check if created function exists'::text description,
TT_FctExists('public', 'translate_with_logging', ARRAY['name', 'name', 'name', 'boolean', 'boolean', 'text', 'integer', 'boolean', 'boolean', 'boolean']) IS TRUE passed
--------------------------------------------------------
UNION ALL
SELECT '7.2'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test without schema name'::text description,
TT_FctExists('translate_with_logging', ARRAY['name', 'name', 'name', 'boolean', 'boolean', 'text', 'integer', 'boolean', 'boolean', 'boolean']) IS TRUE passed
--------------------------------------------------------
UNION ALL
SELECT '7.3'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test without parameters'::text description,
TT_FctExists('translate_with_logging') IS TRUE passed
--------------------------------------------------------
UNION ALL
SELECT '7.4'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test upper and lower case characters'::text description,
TT_FctExists('Public', 'translate_with_logging', ARRAY['Name', 'Name', 'name', 'boOlean', 'booLean', 'text', 'intEger', 'booleaN', 'boolean', 'boolean']) IS TRUE passed
--------------------------------------------------------
UNION ALL
SELECT '7.5'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test without schema name'::text description,
TT_PrepareWithLogging('test_translationtable') = 'SELECT * FROM TT_Translate(''schemaName'', ''tableName'', ''uniqueIDColumn'');' passed
--------------------------------------------------------
UNION ALL
SELECT '7.6'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test suffix'::text description,
TT_PrepareWithLogging('public', 'test_translationtable', '_01') = 'SELECT * FROM TT_Translate_01(''schemaName'', ''tableName'', ''uniqueIDColumn'');' passed
--------------------------------------------------------
UNION ALL
SELECT '7.7'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test with ref translation table having less'::text description,
TT_IsError('SELECT TT_PrepareWithLogging(''public'', ''test_translationtable'', ''_01'', ''test_translationtable2'');') = 'TT_PrepareWithLogging() ERROR: Translation table ''public.test_translationtable'' has more attributes than reference table ''public.test_translationtable2''...' passed
--------------------------------------------------------
UNION ALL
SELECT '7.8'::text number,
'TT_PrepareWithLogging'::text function_tested,
'Test with identical ref translation table'::text description,
TT_PrepareWithLogging('public', 'test_translationtable', '_01', 'test_translationtable') = 'SELECT * FROM TT_Translate_01(''schemaName'', ''tableName'', ''uniqueIDColumn'');' passed
*/
--------------------------------------------------------
-- Test 8 - TT_TextFctReturnType
--------------------------------------------------------
UNION ALL
SELECT '8.1'::text number,
'TT_TextFctReturnType'::text function_tested,
'Basic test'::text description,
TT_TextFctReturnType('isbetween', 3) = 'boolean' passed
--------------------------------------------------------
-- Test 9 - TT_TextFctEval
--------------------------------------------------------
UNION ALL
SELECT '9.1'::text number,
'TT_TextFctEval'::text function_tested,
'Basic test'::text description,
TT_TextFctEval('isbetween', '{crown_closure,''0.0'',''2.0''}'::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::boolean, TRUE) passed
--------------------------------------------------------
UNION ALL
SELECT '9.2'::text number,
'TT_TextFctEval'::text function_tested,
'Basic NULLs'::text description,
TT_Iserror('SELECT TT_TextFctEval(NULL, NULL, NULL, NULL::boolean, NULL)') = 'ERROR IN TRANSLATION TABLE: Helper function <NULL>(<NULL>) does not exist.' passed
--------------------------------------------------------
UNION ALL
SELECT '9.3'::text number,
'TT_TextFctEval'::text function_tested,
'Wrong function name'::text description,
TT_Iserror('SELECT TT_TextFctEval(''xisbetween'', ''{crown_closure, 0, 2}''::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::boolean, TRUE)') = 'ERROR IN TRANSLATION TABLE: Helper function xisbetween(text,text,text) does not exist.' passed
--------------------------------------------------------
UNION ALL
SELECT '9.4'::text number,
'TT_TextFctEval'::text function_tested,
'Wrong argument type'::text description,
TT_IsError('SELECT TT_TextFctEval(''isbetween'', ''{crown_closure, 0, ''''b''''}''::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::boolean, TRUE)') = 'ERROR in TT_IsBetween(): max is not a numeric value' passed
--------------------------------------------------------
UNION ALL
SELECT '9.5'::text number,
'TT_TextFctEval'::text function_tested,
'Argument not found in jsonb structure'::text description,
TT_IsError('SELECT TT_TextFctEval(''isbetween'', ''{crown_closureX, 0, 2}''::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::boolean, TRUE)') = 'ERROR IN TRANSLATION TABLE: Source attribute ''crown_closureX'', called in function ''isbetween()'', does not exist in the source table...' passed
--------------------------------------------------------
UNION ALL
SELECT '9.6'::text number,
'TT_TextFctEval'::text function_tested,
'Wrong but compatible return type'::text description,
TT_TextFctEval('isbetween', '{crown_closure, 0.0, 2.0}'::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::int, TRUE) = 1 passed
--------------------------------------------------------
UNION ALL
SELECT '9.7'::text number,
'TT_TextFctEval'::text function_tested,
'Comma separated string, no column names'::text description,
TT_TextFctEval('Concat', '{"{''a'',''b'',''c''}",''-''}'::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::text, TRUE) = 'a-b-c' passed
--------------------------------------------------------
UNION ALL
SELECT '9.8'::text number,
'TT_TextFctEval'::text function_tested,
'Comma separated string, column names only'::text description,
TT_TextFctEval('Concat', '{"{id,crown_closure}",''-''}'::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::text, TRUE) = 'a-1' passed
--------------------------------------------------------
UNION ALL
SELECT '9.9'::text number,
'TT_TextFctEval'::text function_tested,
'Comma separated string, mixed column names and strings'::text description,
TT_TextFctEval('Concat', '{"{id,''b'',crown_closure}",''-''}'::text[], to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::text, TRUE) = 'a-b-1' passed
--------------------------------------------------------
UNION ALL
SELECT '9.10'::text number,
'TT_TextFctEval'::text function_tested,
'NULL parameters for a function not taking parameters'::text description,
TT_TextFctEval('NothingText', NULL, to_jsonb((SELECT r FROM (SELECT * FROM test_sourcetable1 LIMIT 1) r)), NULL::text, TRUE) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '9.11'::text number,
'TT_TextFctEval'::text function_tested,
'NULL parameters and NULL values for a function not taking parameters'::text description,
TT_TextFctEval('NothingText', NULL, NULL, NULL::text, TRUE) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '9.12'::text number,
'TT_TextFctEval'::text function_tested,
'function taking a string with a string beginning with a space'::text description,
TT_TextFctEval('CopyText', '{''aa''}'::text[], NULL, NULL::text, TRUE) = 'aa' passed
--------------------------------------------------------
UNION ALL
SELECT '9.13'::text number,
'TT_TextFctEval'::text function_tested,
'function taking a string with a string beginning with a space'::text description,
TT_TextFctEval('CopyText', '{'' aa ''}'::text[], NULL, NULL::text, TRUE) = ' aa ' passed
--------------------------------------------------------
UNION ALL
SELECT '9.14'::text number,
'TT_TextFctEval'::text function_tested,
'function taking a string with a string beginning with a space'::text description,
TT_TextFctEval('CopyText', '{ src }'::text[], to_jsonb((SELECT r FROM (SELECT ' bb ' src) r)), NULL::text, TRUE) = ' bb ' passed
--------------------------------------------------------
UNION ALL
SELECT '9.15'::text number,
'TT_TextFctEval'::text function_tested,
'function taking a string with a string beginning with a space'::text description,
TT_TextFctEval('CopyText', '{'' src ''}'::text[], to_jsonb((SELECT r FROM (SELECT ' bb ' src) r)), NULL::text, TRUE) = ' src ' passed
--------------------------------------------------------
-- TT_ParseStringList
--------------------------------------------------------
UNION ALL
SELECT '10.1'::text number,
'TT_ParseStringList'::text function_tested,
'No parameters'::text description,
TT_ParseStringList() IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '10.2'::text number,
'TT_ParseStringList'::text function_tested,
'NULL parameter'::text description,
TT_ParseStringList(NULL) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '10.3'::text number,
'TT_ParseStringList'::text function_tested,
'NULL string'::text description,
TT_ParseStringList('NULL') = '{"NULL"}' passed
--------------------------------------------------------
UNION ALL
SELECT '10.4'::text number,
'TT_ParseStringList'::text function_tested,
'NULL string'::text description,
TT_ParseStringList('{NULL}') = '{NULL}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.5'::text number,
'TT_ParseStringList'::text function_tested,
'String and NULL string'::text description,
TT_ParseStringList('{aa, NULL}') = '{aa, NULL}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.6'::text number,
'TT_ParseStringList'::text function_tested,
'string without quotes, spaces are trimmed'::text description,
TT_ParseStringList(' a a ') = '{"a a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.7'::text number,
'TT_ParseStringList'::text function_tested,
'string without quotes with comma'::text description,
TT_ParseStringList('a b ,a') = '{"a b ,a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.8'::text number,
'TT_ParseStringList'::text function_tested,
'single quoted string with comma'::text description,
TT_ParseStringList('''a ,a''') = '{"''a ,a''"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.9'::text number,
'TT_ParseStringList'::text function_tested,
'double quoted string with comma'::text description,
TT_ParseStringList('"a ,a"') = '{"a ,a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.10'::text number,
'TT_ParseStringList'::text function_tested,
'double quoted string with spaces and comma'::text description,
TT_ParseStringList('" a ,a "') = '{" a ,a "}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.11'::text number,
'TT_ParseStringList'::text function_tested,
'double quoted string with doubled single quote'::text description,
TT_ParseStringList('"a ''a"') = '{"a ''a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.12'::text number,
'TT_ParseStringList'::text function_tested,
'double quoted string with doubled single quote and double quotes'::text description,
TT_ParseStringList('"a ''a", "b ''b"') = '{"a ''a\", \"b ''b"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.13'::text number,
'TT_ParseStringList'::text function_tested,
'string looking like a stringlist but is a string because quoted'::text description,
TT_ParseStringList('"{ a ,b ,c ,d }"') = '{"{ a ,b ,c ,d }"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.14'::text number,
'TT_ParseStringList'::text function_tested,
'string with escaped double quote'::text description,
TT_ParseStringList('a "a') = '{"a \"a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.15'::text number,
'TT_ParseStringList'::text function_tested,
'string with escaped double quote'::text description,
TT_ParseStringList('a \"a') = '{"a \\\"a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.16'::text number,
'TT_ParseStringList'::text function_tested,
'double quoted string with non-escaped double quote'::text description,
TT_ParseStringList('"a "a"') = '{"a \"a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.17'::text number,
'TT_ParseStringList'::text function_tested,
'double quoted string with escaped double quote'::text description,
TT_ParseStringList('"a \"a"') = '{"a \\\"a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.18'::text number,
'TT_ParseStringList'::text function_tested,
'basic stringlist'::text description,
TT_ParseStringList('{ a ,b ,c ,d }') = '{a,b,c,d}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.19'::text number,
'TT_ParseStringList'::text function_tested,
'basic stringlist surrounded by spaces'::text description,
TT_ParseStringList(' { a ,b ,c ,d } ') = '{a,b,c,d}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.20'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with one double quoted string and one single quoted string'::text description,
TT_ParseStringList('{ a ," b ",c ,'' d '' }') = '{a," b ",c,"'' d ''"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.21'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with one single quoted string and one double quoted string'::text description,
TT_ParseStringList('{''str 1'', "str 2"}') = '{"''str 1''","str 2"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.22'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with two quoted strings with comma'::text description,
TT_ParseStringList('{" a ,b" ,"c ,d "}') = '{" a ,b","c ,d "}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.23'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with two quoted strings with single quotes'::text description,
TT_ParseStringList('{"a ''a", "b ''b"}') = '{"a ''a","b ''b"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.24'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with two double quoted strings, one with double quotes inside'::text description,
TT_ParseStringList('{"a \"b" ," , a"}') = '{"a \"b"," , a"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.25'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with one double quoted strings with double quotes inside and one unquoted string with space'::text description,
TT_ParseStringList('{"a \"b" , a b}') = '{"a \"b","a b"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.26'::text number,
'TT_ParseStringList'::text function_tested,
'stringlist with one single quoted strings with one single quoted strings with double quotes inside'::text description,
TT_ParseStringList('{a a, ''b \"b''}') = '{"a a","''b \"b''"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.27'::text number,
'TT_ParseStringList'::text function_tested,
'old test - two strings'::text description,
TT_ParseStringList('{''str 1'', "str @-_= //2"}') = '{"''str 1''","str @-_= //2"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.28'::text number,
'TT_ParseStringList'::text function_tested,
'old test - two column names'::text description,
TT_ParseStringList('{column_A, column-B}') = '{column_A,column-B}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.29'::text number,
'TT_ParseStringList'::text function_tested,
'old test - one single quoted string and one column name'::text description,
TT_ParseStringList('{''string 1'', column_A}') = '{''string 1'',column_A}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.30'::text number,
'TT_ParseStringList'::text function_tested,
'old test - two column names'::text description,
TT_ParseStringList('{''string 1 ''}') = '{''string 1 ''}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.31'::text number,
'TT_ParseStringList'::text function_tested,
'old test - one column name'::text description,
TT_ParseStringList('{column_A}') = '{column_A}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.32'::text number,
'TT_ParseStringList'::text function_tested,
'old test - one column name'::text description,
TT_ParseStringList('{column A}') = '{column A}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.33'::text number,
'TT_ParseStringList'::text function_tested,
'old test - one column name'::text description,
TT_ParseStringList('{''string1'',"string 2"}', TRUE) = '{string1,"string 2"}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.34'::text number,
'TT_ParseStringList'::text function_tested,
'malformed string array'::text description,
TT_IsError('SELECT TT_ParseStringList(''{''''string1'''',}'');') = 'malformed array literal: "{''string1'',}"' passed
--------------------------------------------------------
UNION ALL
SELECT '10.35'::text number,
'TT_ParseStringList'::text function_tested,
'integer array'::text description,
TT_ParseStringList('{-134, 4567}') = '{-134,4567}'::text[] passed
--------------------------------------------------------
UNION ALL
SELECT '10.36'::text number,
'TT_ParseStringList'::text function_tested,
'string with single quotes'::text description,
TT_ParseStringList(''' a ,a ''') = '{"'' a ,a ''"}'::text[] passed
--------------------------------------------------------
-- TT_RepackStringList test
--------------------------------------------------------
UNION ALL
SELECT '11.1'::text number,
'TT_RepackStringList'::text function_tested,
'No parameters'::text description,
TT_RepackStringList() IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '11.2'::text number,
'TT_RepackStringList'::text function_tested,
'NULL parameter'::text description,
TT_RepackStringList(NULL) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '11.3'::text number,
'TT_RepackStringList'::text function_tested,
'NULL parameter'::text description,
TT_RepackStringList(NULL, NULL) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '11.4'::text number,
'TT_RepackStringList'::text function_tested,
'NULL parameter, toSQL'::text description,
TT_RepackStringList(NULL, TRUE) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '11.5'::text number,
'TT_RepackStringList'::text function_tested,
'NULL string'::text description,
TT_RepackStringList('{"NULL"}'::text[]) = 'NULL' passed
--------------------------------------------------------
UNION ALL
SELECT '11.6'::text number,
'TT_RepackStringList'::text function_tested,
'NULL string, toSQL'::text description,
TT_RepackStringList('{"NULL"}'::text[], TRUE) = 'NULL' passed
--------------------------------------------------------
UNION ALL
SELECT '11.7'::text number,
'TT_RepackStringList'::text function_tested,
'NULL string'::text description,
TT_RepackStringList('{NULL}'::text[]) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '11.8'::text number,
'TT_RepackStringList'::text function_tested,
'NULL string, toSQL'::text description,
TT_RepackStringList('{NULL}'::text[], TRUE) IS NULL passed
--------------------------------------------------------
UNION ALL
SELECT '11.9'::text number,
'TT_RepackStringList'::text function_tested,
'String and NULL string'::text description,
TT_RepackStringList('{aa, NULL}'::text[]) = '{"aa",NULL}' passed
--------------------------------------------------------
UNION ALL
SELECT '11.10'::text number,
'TT_RepackStringList'::text function_tested,
'String and NULL string, toSQL'::text description,
TT_RepackStringList('{aa, NULL}'::text[], TRUE) = 'ARRAY[aa,NULL]' passed
--------------------------------------------------------
UNION ALL
SELECT '11.11'::text number,
'TT_RepackStringList'::text function_tested,
'string without quotes, spaces are trimmed'::text description,
--TT_RepackStringList('{"a a"}'::text[]) = '"a a"' passed
TT_RepackStringList('{"a a"}'::text[]) = 'a a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.12'::text number,
'TT_RepackStringList'::text function_tested,
'string without quotes, spaces are trimmed, toSQL'::text description,
--TT_RepackStringList('{"a a"}'::text[]) = '"a a"' passed
TT_RepackStringList('{"a a"}'::text[], TRUE) = 'a a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.13'::text number,
'TT_RepackStringList'::text function_tested,
'string without quotes with comma'::text description,
--TT_RepackStringList('{"a b ,a"}'::text[]) = '"a b ,a"' passed
TT_RepackStringList('{"a b ,a"}'::text[]) = 'a b ,a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.14'::text number,
'TT_RepackStringList'::text function_tested,
'string without quotes with comma, toSQL'::text description,
--TT_RepackStringList('{"a b ,a"}'::text[]) = '"a b ,a"' passed
TT_RepackStringList('{"a b ,a"}'::text[], TRUE) = 'a b ,a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.15'::text number,
'TT_RepackStringList'::text function_tested,
'single quoted string with comma'::text description,
--TT_RepackStringList('{"''a ,a''"}'::text[]) = '"''a ,a''"' passed
TT_RepackStringList('{"''a ,a''"}'::text[]) = '''a ,a''' passed
--------------------------------------------------------
UNION ALL
SELECT '11.16'::text number,
'TT_RepackStringList'::text function_tested,
'single quoted string with comma, toSQL'::text description,
--TT_RepackStringList('{"''a ,a''"}'::text[]) = '"''a ,a''"' passed
TT_RepackStringList('{"''a ,a''"}'::text[], TRUE) = '''a ,a''' passed
--------------------------------------------------------
UNION ALL
SELECT '11.17'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with comma'::text description,
--TT_RepackStringList('{"a ,a"}'::text[]) = '"a ,a"' passed
TT_RepackStringList('{"a ,a"}'::text[]) = 'a ,a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.18'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with comma, toSQL'::text description,
--TT_RepackStringList('{"a ,a"}'::text[]) = '"a ,a"' passed
TT_RepackStringList('{"a ,a"}'::text[], TRUE) = 'a ,a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.19'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with spaces and comma'::text description,
--TT_RepackStringList('{" a ,a "}'::text[]) = '" a ,a "' passed
TT_RepackStringList('{" a ,a "}'::text[]) = ' a ,a ' passed
--------------------------------------------------------
UNION ALL
SELECT '11.20'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with spaces and comma, toSQL'::text description,
--TT_RepackStringList('{" a ,a "}'::text[]) = '" a ,a "' passed
TT_RepackStringList('{" a ,a "}'::text[], TRUE) = ' a ,a ' passed
--------------------------------------------------------
UNION ALL
SELECT '11.21'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with doubled single quote'::text description,
--TT_RepackStringList('{"a ''a"}'::text[]) = '"a ''a"' passed
TT_RepackStringList('{"a ''a"}'::text[]) = 'a ''a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.22'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with doubled single quote, toSQL'::text description,
--TT_RepackStringList('{"a ''a"}'::text[]) = '"a ''a"' passed
TT_RepackStringList('{"a ''a"}'::text[], TRUE) = 'a ''a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.23'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with doubled single quote and double quotes'::text description,
--TT_RepackStringList('{"a ''a\", \"b ''b"}'::text[]) = '"a ''a", "b ''b"' passed
TT_RepackStringList('{"a ''a\", \"b ''b"}'::text[]) = 'a ''a", "b ''b' passed
--------------------------------------------------------
UNION ALL
SELECT '11.24'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with doubled single quote and double quotes, toSQL'::text description,
--TT_RepackStringList('{"a ''a\", \"b ''b"}'::text[]) = '"a ''a", "b ''b"' passed
TT_RepackStringList('{"a ''a\", \"b ''b"}'::text[], TRUE) = 'a ''a", "b ''b' passed
--------------------------------------------------------
UNION ALL
SELECT '11.25'::text number,
'TT_RepackStringList'::text function_tested,
'string looking like a stringlist but is a string because quoted'::text description,
--TT_RepackStringList('{"{ a ,b ,c ,d }"}'::text[]) = '"{ a ,b ,c ,d }"' passed
TT_RepackStringList('{"{ a ,b ,c ,d }"}'::text[]) = '{ a ,b ,c ,d }' passed
--------------------------------------------------------
UNION ALL
SELECT '11.26'::text number,
'TT_RepackStringList'::text function_tested,
'string looking like a stringlist but is a string because quoted, toSQL'::text description,
--TT_RepackStringList('{"{ a ,b ,c ,d }"}'::text[]) = '"{ a ,b ,c ,d }"' passed
TT_RepackStringList('{"{ a ,b ,c ,d }"}'::text[], TRUE) = '{ a ,b ,c ,d }' passed
--------------------------------------------------------
UNION ALL
SELECT '11.27'::text number,
'TT_RepackStringList'::text function_tested,
'string with escaped double quote'::text description,
TT_RepackStringList('{"a \"a"}'::text[]) = 'a "a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.28'::text number,
'TT_RepackStringList'::text function_tested,
'string with escaped double quote, toSQL'::text description,
TT_RepackStringList('{"a \"a"}'::text[], TRUE) = 'a "a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.29'::text number,
'TT_RepackStringList'::text function_tested,
'string with escaped double quote'::text description,
TT_RepackStringList('{"a \\\"a"}'::text[]) = 'a \"a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.30'::text number,
'TT_RepackStringList'::text function_tested,
'string with escaped double quote, toSQL'::text description,
TT_RepackStringList('{"a \\\"a"}'::text[], TRUE) = 'a \"a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.31'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with non-escaped double quote'::text description,
TT_RepackStringList('{"a \"a"}'::text[]) = 'a "a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.32'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with non-escaped double quote, toSQL'::text description,
TT_RepackStringList('{"a \"a"}'::text[], TRUE) = 'a "a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.33'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with escaped double quote'::text description,
TT_RepackStringList('{"a \\\"a"}'::text[]) = 'a \"a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.34'::text number,
'TT_RepackStringList'::text function_tested,
'double quoted string with escaped double quote, toSQL'::text description,
TT_RepackStringList('{"a \\\"a"}'::text[], TRUE) = 'a \"a' passed
--------------------------------------------------------
UNION ALL
SELECT '11.35'::text number,
'TT_RepackStringList'::text function_tested,
'basic stringlist'::text description,
TT_RepackStringList('{a,b,c,d}'::text[]) = '{"a","b","c","d"}' passed
--------------------------------------------------------
UNION ALL
SELECT '11.36'::text number,
'TT_RepackStringList'::text function_tested,
'basic stringlist, toSQL'::text description,
TT_RepackStringList('{a,b,c,d}'::text[], TRUE) = 'ARRAY[a,b,c,d]' passed
--------------------------------------------------------
UNION ALL
SELECT '11.37'::text number,
'TT_RepackStringList'::text function_tested,
'basic stringlist surrounded by spaces'::text description,
TT_RepackStringList(' {a,b,c,d} '::text[]) = '{"a","b","c","d"}' passed
--------------------------------------------------------
UNION ALL
SELECT '11.38'::text number,
'TT_RepackStringList'::text function_tested,