build block-size=28 collectors=(suffix)
a@5.SET.1:15
b@2.SET.2:86
c@9.SET.3:72
d@3.SET.4:21
e@2.SET.5:47
f@0.SET.6:54
g@8.SET.7:63
h@3.SET.8:38
----
point:    [a@5#1,SET-h@3#8,SET]
seqnums:  [1-8]

collectors
----
0: suffix

table-props
----
0: [0, 10)

block-props
----
b@2:
  0: [2, 6)
d@3:
  0: [3, 10)
f@0:
  0: [0, 3)
i:
  0: [3, 9)

# Test an interator with a bound-limited filter that has a filtering criteria
# too narrow to exclude any blocks.

iter filter=(suffix,1,20)
first
next
next
next
next
next
next
next
next
----
    filter.Intersects([2, 6)) = (true, <nil>)
<a@5:1>
<b@2:2>
    filter.Intersects([3, 10)) = (true, <nil>)
<c@9:3>
<d@3:4>
    filter.Intersects([0, 3)) = (true, <nil>)
<e@2:5>
<f@0:6>
    filter.Intersects([3, 9)) = (true, <nil>)
<g@8:7>
<h@3:8>
.

# Test an interator with a bound-limited filter that excludes one block, the
# third block.

iter filter=(suffix,3,20)
first
next
next
next
next
next
next
----
    filter.Intersects([2, 6)) = (true, <nil>)
<a@5:1>
<b@2:2>
    filter.Intersects([3, 10)) = (true, <nil>)
<c@9:3>
<d@3:4>
    filter.Intersects([0, 3)) = (false, <nil>)
    filter.KeyIsWithinUpperBound(f@0) = true
    filter.Intersects([3, 9)) = (true, <nil>)
<g@8:7>
<h@3:8>
.

# Test the same case but with an upper bound set that prevents skipping the
# block.

iter filter=(suffix,3,20) filter-upper=f@9
first
next
next
next
next
next
next
next
next
----
    filter.Intersects([2, 6)) = (true, <nil>)
<a@5:1>
<b@2:2>
    filter.Intersects([3, 10)) = (true, <nil>)
<c@9:3>
<d@3:4>
    filter.Intersects([0, 3)) = (false, <nil>)
    filter.KeyIsWithinUpperBound(f@0) = false
<e@2:5>
<f@0:6>
    filter.Intersects([3, 9)) = (true, <nil>)
<g@8:7>
<h@3:8>
.

# Test the same case above but inject a synthetic suffix 
# that causes block 3 to intersect in the filter

iter filter=(suffix,3,20) synthetic=10
first
next
next
next
next
next
next
----
    filter.SyntheticSuffixIntersects([2, 6)) = (true, <nil>)
<a@5:1>
<b@2:2>
    filter.SyntheticSuffixIntersects([3, 10)) = (true, <nil>)
<c@9:3>
<d@3:4>
    filter.SyntheticSuffixIntersects([0, 3)) = (true, <nil>)
<e@2:5>
<f@0:6>
    filter.SyntheticSuffixIntersects([3, 9)) = (true, <nil>)
<g@8:7>

# Test a case that filters the first two blocks. The third block is not filtered
# due to block-property intersection. The fourth block is not filtered due to
# the upper bound.

iter filter=(suffix,0,1) filter-upper=h@6
first
next
next
next
next
----
    filter.Intersects([2, 6)) = (false, <nil>)
    filter.KeyIsWithinUpperBound(b@2) = true
    filter.Intersects([3, 10)) = (false, <nil>)
    filter.KeyIsWithinUpperBound(d@3) = true
    filter.Intersects([0, 3)) = (true, <nil>)
<e@2:5>
<f@0:6>
    filter.Intersects([3, 9)) = (false, <nil>)
    filter.KeyIsWithinUpperBound(i) = false
<g@8:7>
<h@3:8>
.

# Test a similar case in reverse. In reverse if the very first block is reached,
# we do not know whether or not it's actually within the bounds because we don't
# have another index separator to bound the block. As such, there's no call to
# KeyIsWithinLowerBound for the first block of the sstable [ie, the last one
# visited by the iterator].

iter filter=(suffix,9,10) filter-lower=a@0
last
prev
prev
prev
prev
----
    filter.Intersects([3, 9)) = (false, <nil>)
    filter.KeyIsWithinLowerBound(f@0) = true
    filter.Intersects([0, 3)) = (false, <nil>)
    filter.KeyIsWithinLowerBound(d@3) = true
    filter.Intersects([3, 10)) = (true, <nil>)
<d@3:4>
<c@9:3>
    filter.Intersects([2, 6)) = (false, <nil>)
<b@2:2>
<a@5:1>
.

# Add tests with other non-limited filters set, including one with the same
# Name.
