File: 02export.t

package info (click to toggle)
librdf-kml-exporter-perl 0.003-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 340 kB
  • sloc: perl: 3,404; makefile: 7; sh: 1
file content (36 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (2)
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
use Test::More tests => 1;
use RDF::KML::Exporter;

my $data = [<<'TURTLE', as => 'Turtle', base => 'http://example.com/'];

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix geo:  <http://www.w3.org/2003/01/geo/wgs84_pos#> .

[]
	rdfs:label "Test"@en ;
	a geo:Point ;
	geo:lat 1.23 ;
	geo:long 4.56 .

[]
	a geo:Point ;
	geo:alt 0;
	geo:lat 7.23 ;
	geo:long 8.56 .

TURTLE

my $kml = RDF::KML::Exporter->new->export_kml($data);

like(
	$kml->render,
	qr{
		<Placemark>
			<name>Test</name>
			<Snippet.maxLines="0"/>
			<Point>
				<coordinates>4.56,1.23,0</coordinates>
			</Point>
		</Placemark>
	}x
);