File: lua-basics.feature

package info (click to toggle)
osm2pgsql 2.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,772 kB
  • sloc: cpp: 60,940; python: 1,115; ansic: 763; sh: 25; makefile: 14
file content (51 lines) | stat: -rw-r--r-- 1,399 bytes parent folder | download | duplicates (4)
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
Feature: Flex output uses a Lua config file

    Scenario: Check access to osm2pgsql object from Lua
        Given the OSM data
            """
            """
        And the lua style
            """
            print("version=" .. osm2pgsql.version)
            print("mode=" .. osm2pgsql.mode)
            print("stage=" .. osm2pgsql.stage)
            print("Table=" .. type(osm2pgsql.Table))
            """
        When running osm2pgsql flex
        Then the error output contains
            """
            No output tables defined
            """
        And the standard output contains
            """
            mode=create
            """
        And the standard output contains
            """
            stage=1
            """
        And the standard output contains
            """
            Table=table
            """

    Scenario: Check access to osm2pgsql properties from Lua
        Given the OSM data
            """
            """
        And the lua style
            """
            local p = osm2pgsql.properties
            print("attributes=" .. p.attributes)
            print("prefix=" .. p.prefix)
            """
        When running osm2pgsql flex
        Then the standard output contains
            """
            attributes=false
            """
        And the standard output contains
            """
            prefix=planet_osm
            """