Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 42 additions & 3 deletions tests/testSchema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,27 @@
</xs:annotation>
</xs:element>

<xs:element name="expression" type="Expression">
<xs:choice>
<xs:annotation>
<xs:documentation>The expression to be tested.</xs:documentation>
<xs:documentation>
The item under test: either a single CQL expression, or a complete CQL library.
Exactly one must be provided. Use 'library' instead of 'expression' when the test
requires library-level declarations (e.g. function overloads, parameters, includes,
or multiple named defines); the expected results are then matched to the library's
defines via the 'name' attribute on 'output'.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="expression" type="Expression">
<xs:annotation>
<xs:documentation>The expression to be tested.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="library" type="Library">
<xs:annotation>
<xs:documentation>The complete CQL library to be tested.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
<xs:element name="output" type="Output" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>The expected output of the test.</xs:documentation>
Expand Down Expand Up @@ -199,6 +215,24 @@
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Library">
<xs:annotation>
<xs:documentation>
A complete CQL library provided as the body of the test. The content is the CQL source
text (including the 'library' declaration and any defines/functions). Results are matched
to individual defines via the 'name' attribute on the test's 'output' element(s).
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="invalid" type="InvalidType">
<xs:annotation>
<xs:documentation>Indicates whether the library is expected to translate/evaluate successfully, or to produce a syntax, semantic, or runtime error.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Output">
<xs:simpleContent>
<xs:extension base="xs:string">
Expand All @@ -207,6 +241,11 @@
<xs:documentation>The type of the expected output. If output type is not present, the content of the output is the string representation of a literal (e.g. 10.0)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>For library-style tests, the name of the define whose expected result this output describes (corresponds to a 'define' statement in the library). Omitted for single-expression tests.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Expand Down
Loading