File: 04utf8.t

package info (click to toggle)
librdf-prefixes-perl 0.005-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 208 kB
  • sloc: perl: 281; makefile: 9
file content (24 lines) | stat: -rw-r--r-- 1,193 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use Test::More tests => 11;
use RDF::Prefixes;
use utf8;

foreach ((
	['http://purl.org/dc/terms/'    => undef,     '/ cannot be qnamed'],
	['http://purl.org/dc/terms/tØt' => 'dc:tØt',  'interesting char'],
	['http://purl.org/dc/terms/Øt'  => 'dc:Øt',   'interesting char at start'],
	['http://purl.org/tøt/foo'      => 'tøt:foo', 'interesting char in prefix'],
	['http://purl.org/øt/foo'       => 'øt:foo',  'interesting char at start of prefix'],
	['http://purl.org/tØt/foo'      => 'tøt:foo', 'interesting char in prefix, lowercased'],
	['http://purl.org/Øt/foo'       => 'øt:foo',  'interesting char at start of prefix, lowercased'],
	['http://example.com/τωβυ#ινκστερ' => 'τωβυ:ινκστερ', 'some Greek letters'],
	['http://example.com/Τωβυ#Ινκστερ' => 'τωβυ:Ινκστερ', 'some Greek letters, lowercased'],
	['http://example.com/トビー#インケ'  => 'トビー:インケ',  'some katakana'],
	['http://example.com/𝕥𝕠𝕓𝕪/𝕚𝕟𝕜𝕤𝕥𝕖𝕣' => '𝕥𝕠𝕓𝕪:𝕚𝕟𝕜𝕤𝕥𝕖𝕣', 'some non-BMP characters'],
))
{
	is(
		RDF::Prefixes->new->get_qname($_->[0]),
		$_->[1],
		($_->[2] // $_->[1]),
	);
}