#! /usr/local/bin/perl -w
use
Locale::Util
qw (parse_http_accept_language
parse_http_accept_charset);
BEGIN {
plan
tests
=> NUM_TESTS;
}
my
(
$string
,
@items
,
$items
);
$string
=
"baz; q=0.1, foo, bar; q=0.7"
;
@items
= parse_http_accept_language
$string
;
$items
=
join
'|'
,
@items
;
ok
$items
,
"foo|bar|baz"
;
$string
=
"baz; q=0.1, illegal4this, foo, bar; q=0.7"
;
@items
= parse_http_accept_language
$string
;
$items
=
join
'|'
,
@items
;
ok
$items
,
"foo|bar|baz"
;
$string
=
"baz; q=0.1, *; q=0.05, foo, bar; q=0.7"
;
@items
= parse_http_accept_language
$string
;
$items
=
join
'|'
,
@items
;
ok
$items
,
"foo|bar|baz|C"
;
$string
=
"baz; q=0.1, foo, bar; q=0.7"
;
@items
= parse_http_accept_charset
$string
;
$items
=
join
'|'
,
@items
;
ok
$items
,
"foo|bar|baz"
;