|
Revision 8169, 1.2 kB
(checked in by tschaub, 3 months ago)
|
More short test names, still no functional change.
|
| Line | |
|---|
| 1 |
<html> |
|---|
| 2 |
<head> |
|---|
| 3 |
<script src="../../lib/OpenLayers.js"></script> |
|---|
| 4 |
<script type="text/javascript"> |
|---|
| 5 |
|
|---|
| 6 |
function test_initialize(t) { |
|---|
| 7 |
t.plan(3); |
|---|
| 8 |
|
|---|
| 9 |
var options = {'foo': 'bar'}; |
|---|
| 10 |
var filter = new OpenLayers.Filter.Logical(options); |
|---|
| 11 |
t.ok(filter instanceof OpenLayers.Filter.Logical, |
|---|
| 12 |
"new OpenLayers.Filter.Logical returns object" ); |
|---|
| 13 |
t.eq(filter.foo, "bar", "constructor sets options correctly"); |
|---|
| 14 |
t.eq(typeof filter.evaluate, "function", "filter has an evaluate function"); |
|---|
| 15 |
} |
|---|
| 16 |
|
|---|
| 17 |
function test_destroy(t) { |
|---|
| 18 |
t.plan(1); |
|---|
| 19 |
|
|---|
| 20 |
var filter = new OpenLayers.Filter.Logical(); |
|---|
| 21 |
filter.destroy(); |
|---|
| 22 |
t.eq(filter.filters, null, "filters array nulled properly"); |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
function test_evaluate(t) { |
|---|
| 26 |
t.plan(1); |
|---|
| 27 |
|
|---|
| 28 |
var filter = new OpenLayers.Filter.Logical({ |
|---|
| 29 |
type: OpenLayers.Filter.Logical.NOT}); |
|---|
| 30 |
filter.filters.push(new OpenLayers.Filter()); |
|---|
| 31 |
|
|---|
| 32 |
var feature = new OpenLayers.Feature.Vector(); |
|---|
| 33 |
|
|---|
| 34 |
t.eq(filter.evaluate(feature.attributes), false, |
|---|
| 35 |
"feature evaluates to false correctly."); |
|---|
| 36 |
} |
|---|
| 37 |
</script> |
|---|
| 38 |
</head> |
|---|
| 39 |
<body> |
|---|
| 40 |
</body> |
|---|
| 41 |
</html> |
|---|