openrosa-xpath-evaluator
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "openrosa-xpath-evaluator", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Wrapper for browsers' XPath evaluator with added support for OpenRosa extensions.", | ||
@@ -5,0 +5,0 @@ "main": "src/openrosa-xpath.js", |
@@ -108,3 +108,3 @@ /* | ||
case '%': return lhs.v % rhs.v; | ||
case '=': return lhs.v === rhs.v; | ||
case '=': return lhs.v == rhs.v; | ||
case '<': return lhs.v < rhs.v; | ||
@@ -111,0 +111,0 @@ case '>': return lhs.v > rhs.v; |
@@ -28,2 +28,49 @@ define(['src/openrosa-xpath-extensions', 'src/extended-xpath', 'chai', 'lodash'], function(openRosaXpathExtensions, ExtendedXpathEvaluator, chai, _) { | ||
describe('basic xpath', function() { | ||
describe('comparing node values', function() { | ||
describe('to integer values', function() { | ||
it('should support equality operator', function() { | ||
// given | ||
simpleValueIs(1); | ||
// expect | ||
assert.isTrue(xEval('/simple/xpath/to/node = 1').booleanValue); | ||
}); | ||
it('should support inequality operator', function() { | ||
// given | ||
simpleValueIs(1); | ||
// expect | ||
assert.isFalse(xEval('/simple/xpath/to/node != 1').booleanValue); | ||
}); | ||
it('should support comparators', function() { | ||
// given | ||
simpleValueIs(1); | ||
// expect | ||
assert.isFalse(xEval('/simple/xpath/to/node < 1').booleanValue); | ||
assert.isFalse(xEval('/simple/xpath/to/node > 1').booleanValue); | ||
assert.isTrue(xEval('/simple/xpath/to/node <= 1').booleanValue); | ||
assert.isTrue(xEval('/simple/xpath/to/node >= 1').booleanValue); | ||
}); | ||
}); | ||
describe('to string values', function() { | ||
it('should support equality operator', function() { | ||
// given | ||
simpleValueIs(1); | ||
// expect | ||
assert.isTrue(xEval('/simple/xpath/to/node = "1"').booleanValue); | ||
}); | ||
it('should support inequality operator', function() { | ||
// given | ||
simpleValueIs(1); | ||
// expect | ||
assert.isFalse(xEval('/simple/xpath/to/node != "1"').booleanValue); | ||
}); | ||
}); | ||
}); | ||
}); | ||
describe('openrosa-xpath', function() { | ||
@@ -30,0 +77,0 @@ it('should process simple xpaths', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149839
2442