Commits

Toby Inkster committed ef971ec

getting closer to passing all these XSD tests

  • Participants
  • Parent commits 24c4e08

Comments (0)

Files changed (8)

File devel.w3c-testing/convert-test-cases.pl

 			: ($facets{substr($_->tagName,3)} = $_->{value});
 	}
 	
-	my ($constraint) = grep "XS:\U$_" eq uc($base_type), "Types::XSD"->type_names;
+	my ($constraint) = grep lc("xs:$_") eq lc($base_type), "Types::XSD"->type_names;
 	if ( exists $facets{pattern} )
 	{
+		# XML regexes have these \c and \i things which we'll attempt to fake.
+		$facets{pattern} =~ s/\\c/(?:\$XML::RegExp::NameChar)/g;
+		$facets{pattern} =~ s/\\i/(?:\$XML::RegExp::NameChar)/g;
 		eval { $facets{pattern} = qr{^$facets{pattern}$}ms }
 		or do {
 			print $out "\tlocal \$TODO = \"could not compile regexp\";\n";
-			
 			delete($facets{pattern});
 		};
 	}

File lib/Types/XSD.pm

 declare Notation, as QName;
 
 facet qw( totalDigits fractionDigits pattern whiteSpace enumeration maxInclusiveFloat maxExclusiveFloat minInclusiveFloat minExclusiveFloat ),
-declare Decimal, as Types::Standard::StrMatch[qr{^[+-]?[0-9]+(?:\.[0-9]+)?$}ism];
+declare Decimal, as Types::Standard::StrMatch[qr{^(?:(?:[+-]?[0-9]+(?:\.[0-9]+)?)|(?:[+-]?\.[0-9]+))$}ism];
 
 facet qw( totalDigits fractionDigits pattern whiteSpace enumeration maxInclusive maxExclusive minInclusive minExclusive ),
 declare Integer, as Types::Standard::Int;
 };
 
 subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{11}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('Id', {});
+	my $type = mk_type('Id', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{11}$)/});
 	should_pass("_execution_b", $type, 0);
 	should_pass("ufor-needed.", $type, 0);
 	should_pass("yindustry-in", $type, 0);
 };
 
 subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{55}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('Id', {});
+	my $type = mk_type('Id', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{55}$)/});
 	should_pass("ncross-reference-the_be-collaborate_systems-e-to.the_par", $type, 0);
 	should_pass("yincluding_the_with_use.tools.20_the_retrieves_help-the.", $type, 0);
 	should_pass("uand_are_provide-including.as-discovery-system_is.offer_", $type, 0);
 };
 
 subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{18}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('Id', {});
+	my $type = mk_type('Id', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{18}$)/});
 	should_pass("hand-some.the.parti", $type, 0);
 	should_pass("_to_contribute_stim", $type, 0);
 	should_pass("ktune-degree.from_c", $type, 0);
 };
 
 subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{15}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('Id', {});
+	my $type = mk_type('Id', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{15}$)/});
 	should_pass("kvertical-for.al", $type, 0);
 	should_pass("wto_development-", $type, 0);
 	should_pass("tand.must.provid", $type, 0);
 };
 
 subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{36}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('Id', {});
+	my $type = mk_type('Id', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{36}$)/});
 	should_pass("jsystems_resources_further_without.ba", $type, 0);
 	should_pass("xwill-manipulation.of.describes_and_a", $type, 0);
 	should_pass("_build_process_transactional.around_w", $type, 0);

File t/50NCName.t

 };
 
 subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{16}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('NCName', {});
+	my $type = mk_type('NCName', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{16}$)/});
 	should_pass("ta-reviewed-and-d", $type, 0);
 	should_pass("lwhich.high_parti", $type, 0);
 	should_pass("ias.software-a-th", $type, 0);
 };
 
 subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{40}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('NCName', {});
+	my $type = mk_type('NCName', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{40}$)/});
 	should_pass("onetworking-and_projector-of-tremendous_a", $type, 0);
 	should_pass("rinclude_the-a.the_developers-effort-well", $type, 0);
 	should_pass("wand.forensics.processes.etc_due_that-def", $type, 0);
 };
 
 subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{27}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('NCName', {});
+	my $type = mk_type('NCName', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{27}$)/});
 	should_pass("_a.tools.entire_revolution.o", $type, 0);
 	should_pass("lwill-will-industry_conforma", $type, 0);
 	should_pass("_the.the.industry.which.prob", $type, 0);
 };
 
 subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{12}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('NCName', {});
+	my $type = mk_type('NCName', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{12}$)/});
 	should_pass("oof-and-elect", $type, 0);
 	should_pass("_tests-domain", $type, 0);
 	should_pass("qthe.the-numb", $type, 0);
 };
 
 subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{63}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('NCName', {});
+	my $type = mk_type('NCName', {'pattern' => qr/(?^ums:^[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{63}$)/});
 	should_pass("_to.measurements_registries.would.will-success-testing.known.amb", $type, 0);
 	should_pass("bfor_will_creating.emerging.result-database-language-for_can-inc", $type, 0);
 	should_pass("gand.program_for-that-effective-process-a.and_standards.help-use", $type, 0);

File t/50NMTOKEN.t

 };
 
 subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{40}." => sub {
-	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^\c{40}$)/});
+	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){40}$)/});
 	should_pass("participants.file-interconnecting_will.v", $type, 0);
 	should_pass("computer.systems_their:wide.the:assuring", $type, 0);
 	should_pass("provides.facilitates:known-discussions:o", $type, 0);
 };
 
 subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{18}." => sub {
-	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^\c{18}$)/});
+	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){18}$)/});
 	should_pass("in.typical_tools:m", $type, 0);
 	should_pass("and:Conformance:to", $type, 0);
 	should_pass("tests.clean:succes", $type, 0);
 };
 
 subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{6}." => sub {
-	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^\c{6}$)/});
+	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){6}$)/});
 	should_pass("for_AP", $type, 0);
 	should_pass("XML.to", $type, 0);
 	should_pass("to-Too", $type, 0);
 };
 
 subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{33}." => sub {
-	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^\c{33}$)/});
+	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){33}$)/});
 	should_pass("small-.and.for.these-for:Provide-", $type, 0);
 	should_pass("if_discovery.to_allow-vocabulary_", $type, 0);
 	should_pass("nature.participate.to-key.contrib", $type, 0);
 };
 
 subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{18}." => sub {
-	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^\c{18}$)/});
+	my $type = mk_type('NmToken', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){18}$)/});
 	should_pass("include_internatio", $type, 0);
 	should_pass("repositories.use:c", $type, 0);
 	should_pass("annual-data.a:lies", $type, 0);
 };
 
 subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{45}." => sub {
-	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^\i\c{45}$)/});
+	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){45}$)/});
 	should_pass("finteroperability-these_files-print:a_into_or:", $type, 0);
 	should_pass("icomputing_will:includes:capabilities:need:to:", $type, 0);
 	should_pass("yrecognition.will:security_automating_library_", $type, 0);
 };
 
 subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{52}." => sub {
-	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^\i\c{52}$)/});
+	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){52}$)/});
 	should_pass("ldesktop_object.needs_some:in:collaborating.of-be:app", $type, 0);
 	should_pass("rsignatures:the_are:degree_over_is:tests_technologies", $type, 0);
 	should_pass("uthe:profile-documents-of-we:and_recent_the_own-using", $type, 0);
 };
 
 subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{32}." => sub {
-	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^\i\c{32}$)/});
+	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){32}$)/});
 	should_pass(":a-a.and_s-for-used_means-high_we", $type, 0);
 	should_pass("_the.the-a:raised-to-review-to-hi", $type, 0);
 	should_pass("gleadership_interacting_test.avai", $type, 0);
 };
 
 subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{14}." => sub {
-	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^\i\c{14}$)/});
+	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){14}$)/});
 	should_pass("fof-for-pervasi", $type, 0);
 	should_pass(":necessary_auto", $type, 0);
 	should_pass("tdata_also_seri", $type, 0);
 };
 
 subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{31}." => sub {
-	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^\i\c{31}$)/});
+	my $type = mk_type('Name', {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){31}$)/});
 	should_pass("lscreen-contribute:2001.reposito", $type, 0);
 	should_pass("mmore-s:software:and:each_a:to-f", $type, 0);
 	should_pass("dcan_graphical-for.the.daily.all", $type, 0);
 };
 
 subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{40}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('QName', {});
+	my $type = mk_type('QName', {'pattern' => qr/(?^ums:^([(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]*:)?[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{40}$)/});
 	should_pass("mas_the.and-significant.find-way.environm", $type, 0);
 	should_pass("swork_must_and.partners-and:jmanage_and-of_partnerships.industry-prof", $type, 0);
 	should_pass("ithe.by.and.tools.software-adoption-in-wi", $type, 0);
 };
 
 subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{20}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('QName', {});
+	my $type = mk_type('QName', {'pattern' => qr/(?^ums:^([(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]*:)?[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{20}$)/});
 	should_pass("ithat.and_for_the.in_", $type, 0);
 	should_pass("rwith_s.vir:ddevices.ensure.to_to", $type, 0);
 	should_pass("uknow_provide.must_in", $type, 0);
 };
 
 subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{33}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('QName', {});
+	my $type = mk_type('QName', {'pattern' => qr/(?^ums:^([(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]*:)?[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{33}$)/});
 	should_pass("_buil:hby_to-of.to-computing_significant", $type, 0);
 	should_pass("boffer_draft.obtained-to_systems-g", $type, 0);
 	should_pass("_registry-both-understandi:opopular-processors.is-new_establi", $type, 0);
 };
 
 subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{27}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('QName', {});
+	my $type = mk_type('QName', {'pattern' => qr/(?^ums:^([(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]*:)?[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{27}$)/});
 	should_pass("_known.embed:fdiscover.to.transactional-w", $type, 0);
 	should_pass("qg_o:oboth.to.location-that.of.sy", $type, 0);
 	should_pass("luser-and-that.business_inte", $type, 0);
 };
 
 subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{58}." => sub {
-	local $TODO = "could not compile regexp";
-	my $type = mk_type('QName', {});
+	my $type = mk_type('QName', {'pattern' => qr/(?^ums:^([(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]*:)?[(?:$XML::RegExp::NameChar)-[:]][(?:$XML::RegExp::NameChar)-[:]]{58}$)/});
 	should_pass("pare.to-debug-discover.hardware-information-is_frameworks_i", $type, 0);
 	should_pass("sall_ability.emerging-lacking_a.to-registry.are_retrieval_p", $type, 0);
 	should_pass("_original:efirst_intelligent_industries_who.repository-as.the_to.defi", $type, 0);

File t/50anyURI.t

 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,7}\\.){1,2}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,7}\.){1,2}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,7}\.){1,2}(?:$XML::RegExp::NameChar){3}$)/});
 	should_pass("gopher://Sty.reques.org", $type, 0);
 	should_pass("telnet://wirel.oldert.org", $type, 0);
 	should_pass("telnet://beth.edu", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,3}\\.){1,4}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,3}\.){1,4}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,3}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/});
 	should_pass("telnet://mo.X.th.com", $type, 0);
 	should_pass("news://thu.o.pro.wid.com", $type, 0);
 	should_pass("ftp://b.Co.and.net", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,7}\\.){1,4}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,7}\.){1,4}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,7}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/});
 	should_pass("ftp://XSLthat.incons.isdispl.softwa.org", $type, 0);
 	should_pass("ftp://too.edu", $type, 0);
 	should_pass("ftp://indust.Aso.dra.gov", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,6}\\.){1,2}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,6}\.){1,2}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,6}\.){1,2}(?:$XML::RegExp::NameChar){3}$)/});
 	should_pass("ftp://techn.using.gov", $type, 0);
 	should_pass("ftp://the.com", $type, 0);
 	should_pass("telnet://these.s.org", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,10}\\.){1,5}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,10}\.){1,5}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,10}\.){1,5}(?:$XML::RegExp::NameChar){3}$)/});
 	should_pass("telnet://and.the.thattesti.andspeci.im.gov", $type, 0);
 	should_pass("ftp://beingamon.I.net", $type, 0);
 	should_pass("gopher://whoservi.theXSL.fact.ma.net", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,2}\\.){1,5}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,2}\.){1,5}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,2}\.){1,5}(?:$XML::RegExp::NameChar){3}$)/});
 	should_fail("ftp://eachbewit.otherwilleXtens.follow.lawbeaande.XMLus.repositor.com", $type, 0);
 	should_fail("http://build.theamongimag.becom.OASIScompu.thedue.XMLbusinessis.organizations.gov", $type, 0);
 	should_fail("http://regist.stimu.waysmanyth.andprofil.exchang.knownagraphi.ECprovidedCom.otherSchemape.edu", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,3}\\.){1,4}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,3}\.){1,4}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,3}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/});
 	should_fail("ftp://toregist.thesecanther.NISTme.thefor.amongthosesuch.andtonetw.org", $type, 0);
 	should_fail("gopher://aInternetthela.Virtuallyso.software.communi.widelyTo.usedtheover.andeachS.com", $type, 0);
 	should_fail("ftp://andbothreposit.regis.revolutioniz.oncreatedt.resourcesI.usingandmakeNI.org", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,5}\\.){1,4}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,5}\.){1,4}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,5}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/});
 	should_fail("news://olderperfo.totempla.forlanguageth.thesethecreate.towidetotheb.abilitySchema.useofyears.edu", $type, 0);
 	should_fail("telnet://filewithinD.thecomputera.byresidesitp.nointhemsi.arecreates.withtodocuments.accomplishsec.gov", $type, 0);
 	should_fail("ftp://Businessdepe.thebenefitswo.SOCgovernment.referencech.deployedTh.aroledistrib.andXMLarepub.com", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,10}\\.){1,3}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,10}\.){1,3}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,10}\.){1,3}(?:$XML::RegExp::NameChar){3}$)/});
 	should_fail("telnet://aboutdevelopm.referenceofreg.mustthebuildLan.ofamongAtois.andtheandmust.certainOASI.theInternetaan.thethetheseus.com", $type, 0);
 	should_fail("gopher://CPUtographics.ebXMLArchitec.furthertheofa.thecomplexadd.fourcorrection.ofrelatedvo.com", $type, 0);
 	should_fail("ftp://scomputingth.certaintheof.issueselectroni.thetechnologie.partnersofthis.gov", $type, 0);
 };
 
 subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,7}\\.){1,3}\\c{3}." => sub {
-	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^\c{3,6}:\/\/(\c{1,7}\.){1,3}\c{3}$)/});
+	my $type = mk_type(undef, {'pattern' => qr/(?^ums:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,7}\.){1,3}(?:$XML::RegExp::NameChar){3}$)/});
 	should_fail("gopher://mustNISTproc.aselectronican.systemsstan.andwireles.Informationa.definecanfo.completi.wouldofanat.gov", $type, 0);
 	should_fail("telnet://aparadigmsta.XMLstake.dataaregr.repositori.signaturesNat.andprocessdocum.gov", $type, 0);
 	should_fail("news://understandthe.including.whichamong.partnerships.andsupplytest.contribut.forofhel.net", $type, 0);