@@ -16,21 +16,21 @@ function osm2pgsql.process_node(object)
1616 local test_type = object .tags .type
1717
1818 if test_type == ' nil' then
19- test_table :add_row ( )
19+ test_table :insert ({} )
2020 return
2121 end
2222 if test_type == ' boolean' then
2323 local row = { tbool = true , tint2 = true , tint4 = true ,
2424 tint8 = true , tjson = true , tdirn = true }
25- test_table :add_row (row )
25+ test_table :insert (row )
2626
2727 row = { tbool = false , tint2 = false , tint4 = false ,
2828 tint8 = false , tjson = false , tdirn = false }
29- test_table :add_row (row )
29+ test_table :insert (row )
3030 return
3131 end
3232 if test_type == ' boolean-fail' then
33- test_table :add_row { [object .tags .column ] = true }
33+ test_table :insert { [object .tags .column ] = true }
3434 return
3535 end
3636 if test_type == ' number' then
@@ -40,7 +40,7 @@ function osm2pgsql.process_node(object)
4040 2 ^ 15 - 1 , 2 ^ 15 , 2 ^ 15 + 1 ,
4141 2 ^ 31 - 1 , 2 ^ 31 , 2 ^ 31 + 1 }
4242 for _ , n in ipairs (numbers ) do
43- test_table :add_row {
43+ test_table :insert {
4444 ttext = n ,
4545 tbool = n ,
4646 tint2 = n ,
@@ -55,36 +55,36 @@ function osm2pgsql.process_node(object)
5555 return
5656 end
5757 if test_type == ' number-fail' then
58- test_table :add_row { [object .tags .column ] = 1 }
58+ test_table :insert { [object .tags .column ] = 1 }
5959 return
6060 end
6161 if test_type == ' string-bool' then
62- test_table :add_row { tbool = ' 1' , ttext = ' istrue' };
63- test_table :add_row { tbool = ' yes' , ttext = ' istrue' };
64- test_table :add_row { tbool = ' true' , ttext = ' istrue' };
62+ test_table :insert { tbool = ' 1' , ttext = ' istrue' };
63+ test_table :insert { tbool = ' yes' , ttext = ' istrue' };
64+ test_table :insert { tbool = ' true' , ttext = ' istrue' };
6565
66- test_table :add_row { tbool = ' 0' , ttext = ' isfalse' };
67- test_table :add_row { tbool = ' no' , ttext = ' isfalse' };
68- test_table :add_row { tbool = ' false' , ttext = ' isfalse' };
66+ test_table :insert { tbool = ' 0' , ttext = ' isfalse' };
67+ test_table :insert { tbool = ' no' , ttext = ' isfalse' };
68+ test_table :insert { tbool = ' false' , ttext = ' isfalse' };
6969
70- test_table :add_row { tbool = ' ' , ttext = ' isnull' };
71- test_table :add_row { tbool = ' 2' , ttext = ' isnull' };
72- test_table :add_row { tbool = ' YES' , ttext = ' isnull' };
70+ test_table :insert { tbool = ' ' , ttext = ' isnull' };
71+ test_table :insert { tbool = ' 2' , ttext = ' isnull' };
72+ test_table :insert { tbool = ' YES' , ttext = ' isnull' };
7373 return
7474 end
7575 if test_type == ' string-direction' then
76- test_table :add_row { tdirn = ' 1' , tint2 = 1 };
77- test_table :add_row { tdirn = ' yes' , tint2 = 1 };
76+ test_table :insert { tdirn = ' 1' , tint2 = 1 };
77+ test_table :insert { tdirn = ' yes' , tint2 = 1 };
7878
79- test_table :add_row { tdirn = ' 0' , tint2 = 0 };
80- test_table :add_row { tdirn = ' no' , tint2 = 0 };
79+ test_table :insert { tdirn = ' 0' , tint2 = 0 };
80+ test_table :insert { tdirn = ' no' , tint2 = 0 };
8181
82- test_table :add_row { tdirn = ' -1' , tint2 = - 1 };
82+ test_table :insert { tdirn = ' -1' , tint2 = - 1 };
8383
84- test_table :add_row { tdirn = ' 2' , tint2 = nil };
85- test_table :add_row { tdirn = ' -2' , tint2 = nil };
86- test_table :add_row { tdirn = ' ' , tint2 = nil };
87- test_table :add_row { tdirn = ' FOO' , tint2 = nil };
84+ test_table :insert { tdirn = ' 2' , tint2 = nil };
85+ test_table :insert { tdirn = ' -2' , tint2 = nil };
86+ test_table :insert { tdirn = ' ' , tint2 = nil };
87+ test_table :insert { tdirn = ' FOO' , tint2 = nil };
8888 return
8989 end
9090 if test_type == ' string-with-number' then
@@ -94,7 +94,7 @@ function osm2pgsql.process_node(object)
9494 2 ^ 15 - 1 , 2 ^ 15 , 2 ^ 15 + 1 ,
9595 2 ^ 31 - 1 , 2 ^ 31 , 2 ^ 31 + 1 }
9696 for _ , n in ipairs (numbers ) do
97- test_table :add_row {
97+ test_table :insert {
9898 ttext = string.format (' %d' , n ),
9999 tint2 = string.format (' %d' , n ),
100100 tint4 = string.format (' %d' , n ),
@@ -103,7 +103,7 @@ function osm2pgsql.process_node(object)
103103 tsqlt = string.format (' %d' , n ),
104104 }
105105 end
106- test_table :add_row {
106+ test_table :insert {
107107 ttext = ' 42' ,
108108 tint2 = ' 42' ,
109109 tint4 = ' 42' ,
@@ -116,7 +116,7 @@ function osm2pgsql.process_node(object)
116116 if test_type == ' string-with-invalid-number' then
117117 local not_numbers = { ' ' , ' abc' , ' 0a' , ' 0xa' , ' --1' , ' 1foo' , ' 1.2' }
118118 for _ , n in ipairs (not_numbers ) do
119- test_table :add_row {
119+ test_table :insert {
120120 ttext = n ,
121121 tint2 = n ,
122122 tint4 = n ,
@@ -127,25 +127,25 @@ function osm2pgsql.process_node(object)
127127 return
128128 end
129129 if test_type == ' function-fail' then
130- test_table :add_row { [object .tags .column ] = table.insert }
130+ test_table :insert { [object .tags .column ] = table.insert }
131131 return
132132 end
133133 if test_type == ' table' then
134134 local t = { a = ' b' , c = ' d' }
135- test_table :add_row { thstr = {}, tjson = {} }
136- test_table :add_row { thstr = t , tjson = t }
135+ test_table :insert { thstr = {}, tjson = {} }
136+ test_table :insert { thstr = t , tjson = t }
137137 return
138138 end
139139 if test_type == ' table-hstore-fail' then
140- test_table :add_row { thstr = { num = 1 , bln = true } }
140+ test_table :insert { thstr = { num = 1 , bln = true } }
141141 return
142142 end
143143 if test_type == ' table-fail' then
144- test_table :add_row { [object .tags .column ] = {} }
144+ test_table :insert { [object .tags .column ] = {} }
145145 return
146146 end
147147 if test_type == ' json' then
148- test_table :add_row { tjson = {
148+ test_table :insert { tjson = {
149149 astring = ' 123' ,
150150 aninteger = 124 ,
151151 anumber = 12.5 ,
@@ -160,7 +160,7 @@ function osm2pgsql.process_node(object)
160160 if test_type == ' json-loop' then
161161 local atable = { a = ' b' }
162162 atable .c = atable
163- test_table :add_row { tjson = atable }
163+ test_table :insert { tjson = atable }
164164 return
165165 end
166166end
0 commit comments