From 018e1ba581ec6f01f069a45ec4cf89f152b44d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 19 Mar 2025 15:41:36 +0100 Subject: remerge --- .../cxx/parser/validation/built-in/uri/driver.cxx | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx (limited to 'xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx') diff --git a/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx new file mode 100644 index 0000000..daff0c7 --- /dev/null +++ b/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx @@ -0,0 +1,54 @@ +// file : tests/cxx/parser/validation/built-in/uri/driver.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Test the built-in anyURI type validation. +// +#include + +#include +#include + +using namespace xsd::cxx::parser::validating; + +int +main () +{ + // Good. + // + { + uri_pimpl p; + p.pre (); + p._pre (); + p._characters (" "); + p._post (); + assert (p.post_uri () == ""); + } + + { + uri_pimpl p; + p.pre (); + p._pre (); + p._characters ("relative"); + p._post (); + assert (p.post_uri () == "relative"); + } + + { + uri_pimpl p; + p.pre (); + p._pre (); + p._characters ("#id"); + p._post (); + assert (p.post_uri () == "#id"); + } + + { + uri_pimpl p; + p.pre (); + p._pre (); + p._characters ("http://www.example.com/foo#bar"); + p._post (); + assert (p.post_uri () == "http://www.example.com/foo#bar"); + } +} -- cgit v1.2.3