blob: 53a096f0e8c64c68d7df42baee055cd52432c3d7 [file] [log] [blame]
Akronb2636cf2016-01-26 18:42:44 +01001use strict;
2use warnings;
3use Test::More;
4use File::Basename 'dirname';
5use File::Spec::Functions 'catdir';
6use Data::Dumper;
Akrone4c2e412016-01-28 15:10:50 +01007use KorAP::XML::Tokenizer;
8use KorAP::XML::Krill;
Akronb2636cf2016-01-26 18:42:44 +01009use utf8;
10
11my $path = catdir(dirname(__FILE__), 'TEST', 'BSP', 1);
12
Akrone4c2e412016-01-28 15:10:50 +010013ok(my $doc = KorAP::XML::Krill->new(
Akronb2636cf2016-01-26 18:42:44 +010014 path => $path . '/'
15), 'Create Document');
16
17ok($doc->parse, 'Parse document');
18
19like($doc->path, qr!$path/!, 'Path');
20
21# Metdata
22is($doc->text_sigle, 'TEST_BSP.1', 'ID-text');
23is($doc->doc_sigle, 'TEST_BSP', 'ID-doc');
24is($doc->corpus_sigle, 'TEST', 'ID-corpus');
25
Akrona8665782016-01-27 21:47:57 +010026is($doc->title, 'Sommerüberraschung', 'title');
27#is($doc->sub_title, 'Beispiel Text Untertitel', 'title');
28#is($doc->pub_date, '20010402', 'Publication date');
29#is($doc->pub_place, 'Mannheim', 'Publication place');
30is($doc->author, 'TEST.BSP.Autoren.1', 'Author');
31is($doc->store('sgbrAuthorAgeClass'), 'X', 'AgeClass');
32is($doc->store('sgbrAuthorSex'), 'M', 'Sex');
33is($doc->store('sgbrKodex'), 'M', 'Kodex');
34
35is($doc->doc_title, 'Beispielkorpus', 'Doc: title');
36is($doc->doc_sub_title, 'Subkorpus Beispieltext', 'Doc: subtitle');
37
38is($doc->language, 'de', 'Language');
39
40ok(!$doc->publisher, 'Publisher');
41ok(!$doc->editor, 'Editor');
42ok(!$doc->text_type, 'Text Type');
43ok(!$doc->text_type_art, 'Text Type Art');
44ok(!$doc->text_type_ref, 'Text Type Ref');
45ok(!$doc->text_column, 'Text Column');
46ok(!$doc->text_domain, 'Text Domain');
47ok(!$doc->creation_date, 'Creation Date');
48ok(!$doc->license, 'License');
49ok(!$doc->pages, 'Pages');
50ok(!$doc->file_edition_statement, 'File Edition Statement');
51ok(!$doc->bibl_edition_statement, 'Bibl Edition Statement');
52ok(!$doc->reference, 'Reference');
53
54ok(!$doc->doc_editor, 'Doc: editor');
55ok(!$doc->doc_author, 'Doc: author');
56
57ok(!$doc->corpus_title, 'Corpus: title');
58ok(!$doc->corpus_sub_title, 'Corpus: subtitle');
59ok(!$doc->corpus_editor, 'Corpus: editor');
60ok(!$doc->corpus_author, 'Corpus: author');
Akronb2636cf2016-01-26 18:42:44 +010061
62done_testing;
Akrona8665782016-01-27 21:47:57 +010063
64
65__END__