code: def test_integrity():
      s = fields.Schema(name=fields.TEXT, value=fields.TEXT)
      st = RamStorage()
      ix = st.create_index(s)
  
      w = ix.writer()
      w.add_document(
          name=u("Yellow brown"), value=u("Blue red green purple?")
      )
      w.add_document(
          name=u("Alpha beta"), value=u("Gamma delta epsilon omega.")
      )
      w.commit()
  
      w = ix.writer()
      w.add_document(name=u("One two"), value=u("Three four five."))
      w.commit()
  
      tr = ix.reader()
      assert ix.doc_count_all() == 3
      assert (
          " ".join(tr.field_terms("name"))
          == "alpha beta brown one two yellow"
      )
  
imports: from __future__ import with_statement
  import random
  from collections import defaultdict
  from datetime import datetime
  import pytest
  from whoosh import analysis, fields, index, qparser, query, __version__
  from whoosh.compat import b, u, xrange, text_type, permutations
  from whoosh.filedb.filestore import RamStorage
  from whoosh.writing import IndexingError
  from whoosh.util.numeric import length_to_byte, byte_to_length
  from whoosh.util.testing import TempIndex, TempStorage
label_desc: Use image node_id 5 for calling a global function with example usage: test_integrity() without return types