diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-03 19:21:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-03-03 19:21:50 +0200 |
commit | e4f4f0bed9befbde2117af6f128d9323be3f1638 (patch) | |
tree | 6c41709cdc5fa51b0354b68897a8cc1651b8eb9c /tests/schema | |
parent | ca2bc859cf0001848224ff00a92fcc5d60a16e7f (diff) |
Add union information to the semantics graph
New test: union.
Diffstat (limited to 'tests/schema')
-rw-r--r-- | tests/schema/annotation/test-000.std | 2 | ||||
-rw-r--r-- | tests/schema/anonymous/test-000.std | 6 | ||||
-rw-r--r-- | tests/schema/anonymous/test-001.std | 6 | ||||
-rw-r--r-- | tests/schema/makefile | 2 | ||||
-rw-r--r-- | tests/schema/union/makefile | 35 | ||||
-rw-r--r-- | tests/schema/union/test-000.std | 37 | ||||
-rw-r--r-- | tests/schema/union/test-000.xsd | 40 |
7 files changed, 120 insertions, 8 deletions
diff --git a/tests/schema/annotation/test-000.std b/tests/schema/annotation/test-000.std index ed7f1e1..15f3e89 100644 --- a/tests/schema/annotation/test-000.std +++ b/tests/schema/annotation/test-000.std @@ -6,7 +6,7 @@ primary <list type documentation> list list http://www.w3.org/2001/XMLSchema#string <union type documentation> - union union + union union http://www.w3.org/2001/XMLSchema#int http://www.w3.org/2001/XMLSchema#string <enumeration type documentation> enumeration enum: http://www.w3.org/2001/XMLSchema#string { diff --git a/tests/schema/anonymous/test-000.std b/tests/schema/anonymous/test-000.std index 7acb22b..1f33cb0 100644 --- a/tests/schema/anonymous/test-000.std +++ b/tests/schema/anonymous/test-000.std @@ -1,6 +1,6 @@ -anonymous: test anon_item anon -anonymous: test anon_nested_item anon_nested -anonymous: test anon_nested_item_base anon_nested_item +anonymous: test anon_item anon +anonymous: test anon_nested_item anon_nested +anonymous: test anon_nested_item_base anon_nested_item primary { namespace test diff --git a/tests/schema/anonymous/test-001.std b/tests/schema/anonymous/test-001.std index 11a2aed..cc3f2d1 100644 --- a/tests/schema/anonymous/test-001.std +++ b/tests/schema/anonymous/test-001.std @@ -1,6 +1,6 @@ -anonymous: test anon_base anon -anonymous: test anon_nested_base anon_nested -anonymous: test anon_nested_base_base anon_nested_base +anonymous: test anon_base anon +anonymous: test anon_nested_base anon_nested +anonymous: test anon_nested_base_base anon_nested_base primary { namespace test diff --git a/tests/schema/makefile b/tests/schema/makefile index 9b69ea7..b0fab92 100644 --- a/tests/schema/makefile +++ b/tests/schema/makefile @@ -5,7 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make -tests := annotation anonymous attribute-group element-group default +tests := annotation anonymous attribute-group element-group default union default := $(out_base)/ test := $(out_base)/.test diff --git a/tests/schema/union/makefile b/tests/schema/union/makefile new file mode 100644 index 0000000..498c3cc --- /dev/null +++ b/tests/schema/union/makefile @@ -0,0 +1,35 @@ +# file : tests/schema/union/makefile +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make + +tests := 000 + +driver := $(out_root)/tests/dump/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Convenience alias for default target. +# +$(out_base)/: $(driver) + +# Test. +# +test_targets := $(addprefix $(out_base)/.test-,$(tests)) + +$(test): $(test_targets) +$(test_targets): driver := $(driver) + +.PHONY: $(out_base)/.test-% +$(out_base)/.test-%: $(driver) $(src_base)/test-%.xsd $(src_base)/test-%.std + $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xsd | diff -u $(src_base)/test-$*.std -) + +# Clean. +# +$(clean): + +# Dependencies. +# +$(call import,$(src_root)/tests/dump/makefile) diff --git a/tests/schema/union/test-000.std b/tests/schema/union/test-000.std new file mode 100644 index 0000000..6f95b0c --- /dev/null +++ b/tests/schema/union/test-000.std @@ -0,0 +1,37 @@ +primary +{ + namespace test + { + union u1 http://www.w3.org/2001/XMLSchema#int http://www.w3.org/2001/XMLSchema#string + union u2 + { + enumeration <anonymous>: http://www.w3.org/2001/XMLSchema#token + { + enumerator one + } + } + + { + enumeration <anonymous>: http://www.w3.org/2001/XMLSchema#string + { + enumerator two + } + } + + union u3 http://www.w3.org/2001/XMLSchema#int test#u1 + { + enumeration <anonymous>: http://www.w3.org/2001/XMLSchema#token + { + enumerator one + } + } + + { + enumeration <anonymous>: http://www.w3.org/2001/XMLSchema#string + { + enumerator two + } + } + + } +} diff --git a/tests/schema/union/test-000.xsd b/tests/schema/union/test-000.xsd new file mode 100644 index 0000000..99535de --- /dev/null +++ b/tests/schema/union/test-000.xsd @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <simpleType name="u1"> + <union memberTypes="int string"/> + </simpleType> + + <simpleType name="u2"> + <union> + <simpleType> + <restriction base="token"> + <enumeration value="one"/> + </restriction> + </simpleType> + <simpleType> + <restriction base="string"> + <enumeration value="two"/> + </restriction> + </simpleType> + </union> + </simpleType> + + <simpleType name="u3"> + <union memberTypes=" int + +t:u1 "> + <simpleType> + <restriction base="token"> + <enumeration value="one"/> + </restriction> + </simpleType> + <simpleType> + <restriction base="string"> + <enumeration value="two"/> + </restriction> + </simpleType> + </union> + </simpleType> + +</schema> |