Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-01-31 16:00:20 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-02-04 10:22:46 -0500
commit11109d43612d924f80f74d0a4a847c7a102c6606 (patch)
treee772dd04bef3b5b7ee94cca2a91d8bac94a09508 /core/test/core/vector/table.xml
parent36a3e348b6013798a85e30b443d3842c3849dbb7 (diff)
downloadtame-11109d43612d924f80f74d0a4a847c7a102c6606.tar.gz
tame-11109d43612d924f80f74d0a4a847c7a102c6606.tar.bz2
tame-11109d43612d924f80f74d0a4a847c7a102c6606.zip
core: Add _where-*_ query predicate templates
These provide a more pleasent abstraction than having to reference CMP_OP_* constants. * core/test/core/vector/interpolate.xml: {t:when=>t:where-eq}. * core/test/core/vector/table.xml: Likewise, but using the other variants where appropriate given the value of `@op'. * core/vector/interpolate.xml: Likewise. * core/vector/table.xml (_when_, _where_): Rename former to latter and provide deprecation warning. (_when-lt_, _when-lte_, _when-gt_, _when-gte_): Add abstractions. * src/current/rater.xsd: Permit template variable as tenplate name.
Diffstat (limited to 'core/test/core/vector/table.xml')
-rw-r--r--core/test/core/vector/table.xml52
1 files changed, 26 insertions, 26 deletions
diff --git a/core/test/core/vector/table.xml b/core/test/core/vector/table.xml
index df2b5e3..1491e11 100644
--- a/core/test/core/vector/table.xml
+++ b/core/test/core/vector/table.xml
@@ -122,9 +122,9 @@
<t:it desc="returns first row of multi-row result">
<t:given>
<t:query-first-field table="test-table" field="c">
- <t:when field="a">
+ <t:where-eq field="a">
<c:value-of name="#1" />
- </t:when>
+ </t:where-eq>
</t:query-first-field>
</t:given>
@@ -137,12 +137,12 @@
<t:it desc="returns first row of single-row result">
<t:given>
<t:query-first-field table="test-table" field="c">
- <t:when field="a">
+ <t:where-eq field="a">
<c:value-of name="#1" />
- </t:when>
- <t:when field="b">
+ </t:where-eq>
+ <t:where-eq field="b">
<c:value-of name="#12" />
- </t:when>
+ </t:where-eq>
</t:query-first-field>
</t:given>
@@ -160,9 +160,9 @@
<t:given>
<c:length-of>
<t:query-field table="test-table" field="c">
- <t:when field="a">
+ <t:where-eq field="a">
<c:value-of name="#1" />
- </t:when>
+ </t:where-eq>
</t:query-field>
</c:length-of>
</t:given>
@@ -177,12 +177,12 @@
<t:given>
<c:car>
<t:query-field table="test-table" field="c">
- <t:when field="a">
+ <t:where-eq field="a">
<c:value-of name="#1" />
- </t:when>
- <t:when field="b">
+ </t:where-eq>
+ <t:where-eq field="b">
<c:value-of name="#11" />
- </t:when>
+ </t:where-eq>
</t:query-field>
</c:car>
</t:given>
@@ -218,9 +218,9 @@
<c:values>
<c:value name="results" type="integer" set="vector">
<t:query-field table="test-table-seq" field="a">
- <t:when field="a" op="CMP_OP_LT">
+ <t:where-lt field="a">
<c:value-of name="#5" />
- </t:when>
+ </t:where-lt>
</t:query-field>
</c:value>
</c:values>
@@ -244,9 +244,9 @@
<c:values>
<c:value name="results" type="integer" set="vector">
<t:query-field table="test-table-seq" field="a">
- <t:when field="a" op="CMP_OP_LTE">
+ <t:where-lte field="a">
<c:value-of name="#5" />
- </t:when>
+ </t:where-lte>
</t:query-field>
</c:value>
</c:values>
@@ -270,9 +270,9 @@
<c:values>
<c:value name="results" type="integer" set="vector">
<t:query-field table="test-table-seq" field="a">
- <t:when field="a" op="CMP_OP_GT">
+ <t:where-gt field="a">
<c:value-of name="#5" />
- </t:when>
+ </t:where-gt>
</t:query-field>
</c:value>
</c:values>
@@ -296,9 +296,9 @@
<c:values>
<c:value name="results" type="integer" set="vector">
<t:query-field table="test-table-seq" field="a">
- <t:when field="a" op="CMP_OP_GTE">
+ <t:where-gte field="a">
<c:value-of name="#5" />
- </t:when>
+ </t:where-gte>
</t:query-field>
</c:value>
</c:values>
@@ -323,9 +323,9 @@
<t:given>
<c:length-of>
<t:query-row table="test-table">
- <t:when field="a">
+ <t:where-eq field="a">
<c:value-of name="#1" />
- </t:when>
+ </t:where-eq>
</t:query-row>
</c:length-of>
</t:given>
@@ -343,12 +343,12 @@
<c:value name="first_row" type="integer" set="vector">
<c:car>
<t:query-row table="test-table">
- <t:when field="a">
+ <t:where-eq field="a">
<c:value-of name="#1" />
- </t:when>
- <t:when field="b">
+ </t:where-eq>
+ <t:where-eq field="b">
<c:value-of name="#11" />
- </t:when>
+ </t:where-eq>
</t:query-row>
</c:car>
</c:value>