Merge pull request #105 from Orange-OpenSource/fix/export-predicates-greater-less

Fix export predicates greater less
This commit is contained in:
Fabrice Reix 2020-12-05 12:12:08 +01:00 committed by GitHub
commit 719cbcc552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 41 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/assert-json"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":5}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":5.0}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater-than","value":"1"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater-than","value":"1.0"}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"equal","value":false}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"not":true,"type":"equal","value":null}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"isBoolean"}},{"query":{"type":"jsonpath","expr":"$.errors"},"predicate":{"type":"count","value":2}},{"query":{"type":"jsonpath","expr":"$.errors"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"count","value":0}},{"query":{"type":"jsonpath","expr":"$.toto"},"predicate":{"not":true,"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.errors[0]"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.errors[0]"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.errors[0].id"},"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.errors[0]['id']"},"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"equal","value":1.5}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"less-than-or-equal","value":"2.0"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"greater-than","value":"2"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"isFloat"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"not":true,"type":"isInteger"}},{"query":{"type":"jsonpath","expr":"$.nullable"},"predicate":{"type":"equal","value":null}}],"body":{"type":"json","value":{"count":5,"success":false,"errors":[{"id":"error1"},{"id":"error2"}],"warnings":[],"duration":1.5,"tags":["test"],"nullable":null}}}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/index"},"response":{"version":"HTTP/1.0","status":200,"captures":[{"name":"index","query":{"type":"body"}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.errors[{{index}}].id"},"predicate":{"type":"equal","value":"error2"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"type":"include","value":"test"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"not":true,"type":"include","value":"prod"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"not":true,"type":"include","value":null}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/list"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$"},"predicate":{"type":"count","value":2}},{"query":{"type":"jsonpath","expr":"$.[0].name"},"predicate":{"type":"equal","value":"Bob"}},{"query":{"type":"jsonpath","expr":"$[0].name"},"predicate":{"type":"equal","value":"Bob"}}]}}]} {"entries":[{"request":{"method":"GET","url":"http://localhost:8000/assert-json"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":5}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"equal","value":5.0}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":1}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":1.0}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"equal","value":false}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"not":true,"type":"equal","value":null}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.success"},"predicate":{"type":"isBoolean"}},{"query":{"type":"jsonpath","expr":"$.errors"},"predicate":{"type":"count","value":2}},{"query":{"type":"jsonpath","expr":"$.errors"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"count","value":0}},{"query":{"type":"jsonpath","expr":"$.toto"},"predicate":{"not":true,"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.warnings"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.errors[0]"},"predicate":{"type":"exist"}},{"query":{"type":"jsonpath","expr":"$.errors[0]"},"predicate":{"type":"isCollection"}},{"query":{"type":"jsonpath","expr":"$.errors[0].id"},"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.errors[0]['id']"},"predicate":{"type":"equal","value":"error1"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"equal","value":1.5}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"less-or-equal","value":2.0}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"greater","value":2}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"type":"isFloat"}},{"query":{"type":"jsonpath","expr":"$.duration"},"predicate":{"not":true,"type":"isInteger"}},{"query":{"type":"jsonpath","expr":"$.nullable"},"predicate":{"type":"equal","value":null}}],"body":{"type":"json","value":{"count":5,"success":false,"errors":[{"id":"error1"},{"id":"error2"}],"warnings":[],"duration":1.5,"tags":["test"],"nullable":null}}}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/index"},"response":{"version":"HTTP/1.0","status":200,"captures":[{"name":"index","query":{"type":"body"}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.errors[{{index}}].id"},"predicate":{"type":"equal","value":"error2"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"type":"include","value":"test"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"not":true,"type":"include","value":"prod"}},{"query":{"type":"jsonpath","expr":"$.tags"},"predicate":{"not":true,"type":"include","value":null}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-json/list"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$"},"predicate":{"type":"count","value":2}},{"query":{"type":"jsonpath","expr":"$.[0].name"},"predicate":{"type":"equal","value":"Bob"}},{"query":{"type":"jsonpath","expr":"$[0].name"},"predicate":{"type":"equal","value":"Bob"}}]}}]}

View File

@ -1 +1 @@
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">201</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="comment"># simply check that the status code is not 200</span></span><span class="line"><span class="comment"># do not run implicit assert of http response version and code</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/*</span> <span class="status">*</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">status</span> not <span class="predicate-type">equals</span> <span class="number">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"></span><span class="line"><span class="comment"># simply check that the status code is OK</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/*</span> <span class="status">*</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">status</span> <span class="predicate-type">greater-than-or-equal</span> <span class="number">200</span></span><span class="line"><span class="query-type">status</span> <span class="predicate-type">less-than</span> <span class="number">300</span></span></div></div></div> <div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">201</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="comment"># simply check that the status code is not 200</span></span><span class="line"><span class="comment"># do not run implicit assert of http response version and code</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/*</span> <span class="status">*</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">status</span> not <span class="predicate-type">equals</span> <span class="number">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"></span><span class="line"><span class="comment"># simply check that the status code is OK</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/*</span> <span class="status">*</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">status</span> <span class="predicate-type">greaterThanOrEquals</span> <span class="number">200</span></span><span class="line"><span class="query-type">status</span> <span class="predicate-type">lessThan</span> <span class="number">300</span></span></div></div></div>

View File

@ -1 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/assert-status-code"},"response":{"version":"HTTP/1.0","status":201}},{"request":{"method":"GET","url":"http://localhost:8000/assert-status-code"},"response":{"asserts":[{"query":{"type":"status"},"predicate":{"not":true,"type":"equal","value":200}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-status-code"},"response":{"asserts":[{"query":{"type":"status"},"predicate":{"type":"greater-than-or-equal","value":"200"}},{"query":{"type":"status"},"predicate":{"type":"greater-than","value":"300"}}]}}]} {"entries":[{"request":{"method":"GET","url":"http://localhost:8000/assert-status-code"},"response":{"version":"HTTP/1.0","status":201}},{"request":{"method":"GET","url":"http://localhost:8000/assert-status-code"},"response":{"asserts":[{"query":{"type":"status"},"predicate":{"not":true,"type":"equal","value":200}}]}},{"request":{"method":"GET","url":"http://localhost:8000/assert-status-code"},"response":{"asserts":[{"query":{"type":"status"},"predicate":{"type":"greater-or-equal","value":200}},{"query":{"type":"status"},"predicate":{"type":"greater","value":300}}]}}]}

View File

@ -1 +1 @@
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-value</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="string">"XXX"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.id"</span> <span class="predicate-type">equals</span> <span class="string">"000001"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> <span class="predicate-type">includes</span> <span class="number">100</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> not <span class="predicate-type">contains</span> <span class="string">"Hello"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">greater-than</span> <span class="number">5</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">isFloat</span></span></div></div></div> <div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-value</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="string">"XXX"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.id"</span> <span class="predicate-type">equals</span> <span class="string">"000001"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> <span class="predicate-type">includes</span> <span class="number">100</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> not <span class="predicate-type">contains</span> <span class="string">"Hello"</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">greaterThan</span> <span class="number">5</span></span><span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">isFloat</span></span></div></div></div>

View File

@ -1 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-value"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"header","name":"content-type"},"predicate":{"type":"equal","value":"XXX"}},{"query":{"type":"jsonpath","expr":"$.id"},"predicate":{"type":"equal","value":"000001"}},{"query":{"type":"jsonpath","expr":"$.values"},"predicate":{"type":"include","value":100}},{"query":{"type":"jsonpath","expr":"$.values"},"predicate":{"not":true,"type":"contain","value":"Hello"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater-than","value":"5"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"isFloat"}}]}}]} {"entries":[{"request":{"method":"GET","url":"http://localhost:8000/error-assert-value"},"response":{"version":"HTTP/1.0","status":200,"asserts":[{"query":{"type":"header","name":"content-type"},"predicate":{"type":"equal","value":"XXX"}},{"query":{"type":"jsonpath","expr":"$.id"},"predicate":{"type":"equal","value":"000001"}},{"query":{"type":"jsonpath","expr":"$.values"},"predicate":{"type":"include","value":100}},{"query":{"type":"jsonpath","expr":"$.values"},"predicate":{"not":true,"type":"contain","value":"Hello"}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"greater","value":5}},{"query":{"type":"jsonpath","expr":"$.count"},"predicate":{"type":"isFloat"}}]}}]}

View File

@ -1 +1 @@
<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/large</span></span></div><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Content-Type</span><span>:</span> <span class="string">application/octet-stream</span></span><span class="line"><span class="string">Content-Length</span><span>:</span> <span class="string">536870912</span></span><span class="line"></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">duration</span> <span class="predicate-type">less-than-or-equal</span> <span class="number">10000</span></span></div></div><span class="line"></span><span class="line"></span><span class="line"></span></div> <div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/large</span></span></div><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line"><span class="string">Content-Type</span><span>:</span> <span class="string">application/octet-stream</span></span><span class="line"><span class="string">Content-Length</span><span>:</span> <span class="string">536870912</span></span><span class="line"></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">duration</span> <span class="predicate-type">lessThanOrEquals</span> <span class="number">10000</span></span></div></div><span class="line"></span><span class="line"></span><span class="line"></span></div>

View File

@ -1 +1 @@
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/large"},"response":{"version":"HTTP/1.0","status":200,"headers":[{"name":"Content-Type","value":"application/octet-stream"},{"name":"Content-Length","value":"536870912"}],"asserts":[{"query":{"type":"duration"},"predicate":{"type":"less-than-or-equal","value":"10000"}}]}}]} {"entries":[{"request":{"method":"GET","url":"http://localhost:8000/large"},"response":{"version":"HTTP/1.0","status":200,"headers":[{"name":"Content-Type","value":"application/octet-stream"},{"name":"Content-Length","value":"536870912"}],"asserts":[{"query":{"type":"duration"},"predicate":{"type":"less-or-equal","value":10000}}]}}]}

View File

@ -464,56 +464,56 @@ impl Htmlable for PredicateFuncValue {
); );
} }
PredicateFuncValue::GreaterThanInt { space0, value } => { PredicateFuncValue::GreaterThanInt { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">greater-than</span>"); buffer.push_str("<span class=\"predicate-type\">greaterThan</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::GreaterThanFloat { space0, value } => { PredicateFuncValue::GreaterThanFloat { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">greater-than</span>"); buffer.push_str("<span class=\"predicate-type\">greaterThan</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::GreaterThanOrEqualInt { space0, value } => { PredicateFuncValue::GreaterThanOrEqualInt { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">greater-than-or-equal</span>"); buffer.push_str("<span class=\"predicate-type\">greaterThanOrEquals</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::GreaterThanOrEqualFloat { space0, value } => { PredicateFuncValue::GreaterThanOrEqualFloat { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">greater-than-or-equal</span>"); buffer.push_str("<span class=\"predicate-type\">greaterThanOrEquals</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::LessThanInt { space0, value } => { PredicateFuncValue::LessThanInt { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">less-than</span>"); buffer.push_str("<span class=\"predicate-type\">lessThan</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::LessThanFloat { space0, value } => { PredicateFuncValue::LessThanFloat { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">less-than</span>"); buffer.push_str("<span class=\"predicate-type\">lessThan</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::LessThanOrEqualInt { space0, value } => { PredicateFuncValue::LessThanOrEqualInt { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">less-than-or-equal</span>"); buffer.push_str("<span class=\"predicate-type\">lessThanOrEquals</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),
); );
} }
PredicateFuncValue::LessThanOrEqualFloat { space0, value } => { PredicateFuncValue::LessThanOrEqualFloat { space0, value } => {
buffer.push_str("<span class=\"predicate-type\">less-than-or-equal</span>"); buffer.push_str("<span class=\"predicate-type\">lessThanOrEquals</span>");
buffer.push_str(space0.to_html().as_str()); buffer.push_str(space0.to_html().as_str());
buffer.push_str( buffer.push_str(
format!("<span class=\"number\">{}</span>", value.to_string()).as_str(), format!("<span class=\"number\">{}</span>", value.to_string()).as_str(),

View File

@ -346,57 +346,48 @@ impl ToJson for Predicate {
attributes.push(("value".to_string(), JValue::String(value.to_string()))); attributes.push(("value".to_string(), JValue::String(value.to_string())));
} }
PredicateFuncValue::GreaterThanInt { value, .. } => { PredicateFuncValue::GreaterThanInt { value, .. } => {
attributes.push(( attributes.push(("type".to_string(), JValue::String("greater".to_string())));
"type".to_string(), attributes.push(("value".to_string(), JValue::Number(value.to_string())));
JValue::String("greater-than".to_string()),
));
attributes.push(("value".to_string(), JValue::String(value.to_string())));
} }
PredicateFuncValue::GreaterThanFloat { value, .. } => { PredicateFuncValue::GreaterThanFloat { value, .. } => {
attributes.push(( attributes.push(("type".to_string(), JValue::String("greater".to_string())));
"type".to_string(), attributes.push(("value".to_string(), JValue::Number(value.to_string())));
JValue::String("greater-than".to_string()),
));
attributes.push(("value".to_string(), JValue::String(value.to_string())));
} }
PredicateFuncValue::GreaterThanOrEqualInt { value, .. } => { PredicateFuncValue::GreaterThanOrEqualInt { value, .. } => {
attributes.push(( attributes.push((
"type".to_string(), "type".to_string(),
JValue::String("greater-than-or-equal".to_string()), JValue::String("greater-or-equal".to_string()),
)); ));
attributes.push(("value".to_string(), JValue::String(value.to_string()))); attributes.push(("value".to_string(), JValue::Number(value.to_string())));
} }
PredicateFuncValue::GreaterThanOrEqualFloat { value, .. } => { PredicateFuncValue::GreaterThanOrEqualFloat { value, .. } => {
attributes.push(( attributes.push((
"type".to_string(), "type".to_string(),
JValue::String("greater-than-or-equal".to_string()), JValue::String("greater-or-equal".to_string()),
)); ));
attributes.push(("value".to_string(), JValue::String(value.to_string()))); attributes.push(("value".to_string(), JValue::Number(value.to_string())));
} }
PredicateFuncValue::LessThanInt { value, .. } => { PredicateFuncValue::LessThanInt { value, .. } => {
attributes.push(( attributes.push(("type".to_string(), JValue::String("greater".to_string())));
"type".to_string(), attributes.push(("value".to_string(), JValue::Number(value.to_string())));
JValue::String("greater-than".to_string()),
));
attributes.push(("value".to_string(), JValue::String(value.to_string())));
} }
PredicateFuncValue::LessThanFloat { value, .. } => { PredicateFuncValue::LessThanFloat { value, .. } => {
attributes.push(("type".to_string(), JValue::String("less-than".to_string()))); attributes.push(("type".to_string(), JValue::String("less".to_string())));
attributes.push(("value".to_string(), JValue::String(value.to_string()))); attributes.push(("value".to_string(), JValue::Number(value.to_string())));
} }
PredicateFuncValue::LessThanOrEqualInt { value, .. } => { PredicateFuncValue::LessThanOrEqualInt { value, .. } => {
attributes.push(( attributes.push((
"type".to_string(), "type".to_string(),
JValue::String("less-than-or-equal".to_string()), JValue::String("less-or-equal".to_string()),
)); ));
attributes.push(("value".to_string(), JValue::String(value.to_string()))); attributes.push(("value".to_string(), JValue::Number(value.to_string())));
} }
PredicateFuncValue::LessThanOrEqualFloat { value, .. } => { PredicateFuncValue::LessThanOrEqualFloat { value, .. } => {
attributes.push(( attributes.push((
"type".to_string(), "type".to_string(),
JValue::String("less-than-or-equal".to_string()), JValue::String("less-or-equal".to_string()),
)); ));
attributes.push(("value".to_string(), JValue::String(value.to_string()))); attributes.push(("value".to_string(), JValue::Number(value.to_string())));
} }
PredicateFuncValue::CountEqual { value, .. } => { PredicateFuncValue::CountEqual { value, .. } => {
attributes.push(("type".to_string(), JValue::String("count".to_string()))); attributes.push(("type".to_string(), JValue::String("count".to_string())));