code: def test_resultslength():
      schema = fields.Schema(
          id=fields.ID(stored=True), value=fields.TEXT
      )
      ix = RamStorage().create_index(schema)
  
      w = ix.writer()
      w.add_document(id=u("1"), value=u("alfa alfa alfa alfa alfa"))
      w.add_document(id=u("2"), value=u("alfa alfa alfa alfa"))
      w.add_document(id=u("3"), value=u("alfa alfa alfa"))
      w.add_document(id=u("4"), value=u("alfa alfa"))
      w.add_document(id=u("5"), value=u("alfa"))
      w.add_document(id=u("6"), value=u("bravo"))
      w.commit()
  
      with ix.searcher() as s:
          r = s.search(query.Term("value", u("alfa")), limit=3)
          assert len(r) == 5
          assert r.scored_length() == 3
          assert r[10:] == []
  
imports: from __future__ import with_statement
  import pytest
  from whoosh import analysis, fields, formats, highlight, qparser, query
  from whoosh.codec.whoosh3 import W3Codec
  from whoosh.compat import u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.util.testing import TempStorage, TempIndex
label_desc: Use image node_id 3 for calling a global function with example usage: test_resultslength() without return types