Lingua-Text

 view release on metacpan or  search on metacpan

t/integration.t  view on Meta::CPAN

	# Verify encode() with non-ASCII in presence of injected keys
	my $t2 = Lingua::Text->new(fr => $ETUDE);
	$t2->encode();
	is($t2->fr(), $ETUDE_E, 'fr entity-encoded correctly despite injected keys');
};

# ---------------------------------------------------------------------------
# 12. Locale detection integration: full env-var precedence chain
#
# POD DESCRIPTION: detection uses LANGUAGE, LC_ALL, LC_MESSAGES, LANG
# in that priority order.  This test drives the full detection cascade.
# ---------------------------------------------------------------------------
subtest 'locale detection -- precedence chain' => sub {
	mock 'I18N::LangTags::Detect::detect' => sub { () };    # disable HTTP path

	# LANG lowest priority: used when others absent
	{
		local %ENV;
		$ENV{LANG} = $FR_LOCALE;
		my $t = Lingua::Text->new(en => $EN_TEXT, fr => $FR_TEXT);
		is("$t", $FR_TEXT, 'LANG=fr_FR: stringify returns French');



( run in 1.866 second using v1.01-cache-2.11-cpan-e7c6538aa59 )