@@ -473,9 +473,10 @@ Feature: Index definitions in Lua file
473473 })
474474 """
475475 When running osm2pgsql flex
476- Then SELECT schemaname, tablename FROM pg_catalog.pg_indexes WHERE tablename = 'mytable' AND indexdef LIKE '%USING btree (name)%' AND indexdef LIKE '%WHERE (name = lower(name))%'
477- | schemaname | tablename |
478- | public | mytable |
476+ Then table pg_catalog.pg_indexes contains
477+ | schemaname | tablename | indexdef @fullmatch |
478+ | public | mytable | .*USING btree \(name \).*WHERE \(name = lower \(name \)\).* |
479+
479480
480481 Scenario : Don't create id index if the configuration doesn't mention it
481482 Given the input file 'liechtenstein-2013-08-03.osm.pbf'
@@ -492,10 +493,9 @@ Feature: Index definitions in Lua file
492493 })
493494 """
494495 When running osm2pgsql flex
495- Then table pg_catalog.pg_indexes has 0 rows with condition
496- """
497- schemaname = 'public' AND tablename = 'mytable' AND indexname LIKE '%node_id%'
498- """
496+ Then table pg_catalog.pg_indexes doesn't contain
497+ | schemaname | tablename | indexname @fullmatch |
498+ | public | mytable | .*node_id .* |
499499
500500 Scenario : Don't create id index if the configuration doesn't says so
501501 Given the input file 'liechtenstein-2013-08-03.osm.pbf'
@@ -512,10 +512,9 @@ Feature: Index definitions in Lua file
512512 })
513513 """
514514 When running osm2pgsql flex
515- Then table pg_catalog.pg_indexes has 0 rows with condition
516- """
517- schemaname = 'public' AND tablename = 'mytable' AND indexname LIKE '%node_id%'
518- """
515+ Then table pg_catalog.pg_indexes doesn't contain
516+ | schemaname | tablename | indexname @fullmatch |
517+ | public | mytable | .*node_id .* |
519518
520519 Scenario : Always create id index if the configuration says so
521520 Given the input file 'liechtenstein-2013-08-03.osm.pbf'
@@ -532,10 +531,9 @@ Feature: Index definitions in Lua file
532531 })
533532 """
534533 When running osm2pgsql flex
535- Then table pg_catalog.pg_indexes has 1 rows with condition
536- """
537- schemaname = 'public' AND tablename = 'mytable' AND indexname LIKE '%node_id%'
538- """
534+ Then table pg_catalog.pg_indexes contains
535+ | schemaname | tablename | indexname @fullmatch |
536+ | public | mytable | .*node_id .* |
539537
540538 Scenario : Create a unique id index when requested
541539 Given the input file 'liechtenstein-2013-08-03.osm.pbf'
@@ -553,13 +551,12 @@ Feature: Index definitions in Lua file
553551 """
554552 When running osm2pgsql flex
555553 Then table foo has 1562 rows
556- And SELECT indexdef FROM pg_indexes WHERE tablename = 'foo'
557- | indexdef @fullmatch |
558- | CREATE UNIQUE INDEX .* USING .*\(node_id \) |
559- And table pg_catalog.pg_index has 0 rows with condition
560- """
561- indrelid = 'foo'::regclass and indisprimary
562- """
554+ Then table pg_catalog.pg_indexes contains
555+ | tablename | indexdef @fullmatch |
556+ | foo | CREATE UNIQUE INDEX .* USING .*\(node_id \) |
557+ And SELECT count(*) FROM pg_catalog.pg_index WHERE indrelid = 'foo' ::regclass and indisprimary
558+ | count |
559+ | 0 |
563560
564561 Scenario : Create a primary key id index when requested
565562 Given the input file 'liechtenstein-2013-08-03.osm.pbf'
@@ -577,11 +574,9 @@ Feature: Index definitions in Lua file
577574 """
578575 When running osm2pgsql flex
579576 Then table foo has 1562 rows
580- And SELECT indexdef FROM pg_indexes WHERE tablename = 'foo'
581- | indexdef @fullmatch |
582- | CREATE UNIQUE INDEX .* USING .*\(node_id \) |
583- And table pg_catalog.pg_index has 1 row with condition
584- """
585- indrelid = 'foo'::regclass and indisprimary
586- """
587-
577+ Then table pg_catalog.pg_indexes contains
578+ | tablename | indexdef @fullmatch |
579+ | foo | CREATE UNIQUE INDEX .* USING .*\(node_id \) |
580+ And SELECT count(*) FROM pg_catalog.pg_index WHERE indrelid = 'foo' ::regclass and indisprimary
581+ | count |
582+ | 1 |
0 commit comments