chiark / gitweb /
documentation: improve search short data test to depend on header size.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 12 May 2020 07:12:03 +0000 (09:12 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 12 May 2020 07:20:55 +0000 (09:20 +0200)
So when we move to bigger types, it still catches outdated assumptions.

documentation/test/js-test-data/short.bin
documentation/test/populate-js-test-data.py

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ce004a8421bbd5c0022b80bb8942ac451f21962a 100644 (file)
@@ -0,0 +1 @@
+#############
\ No newline at end of file
index a6410a9488b7ba2fd0da17b23ee3c062bc2d358c..07ffe5ef2e25b648d551e0f0a809dee945b0b657 100755 (executable)
@@ -32,14 +32,14 @@ sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__))))
 sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
 
 from _search_test_metadata import EntryType, search_type_map
-from _search import Trie, ResultMap, ResultFlag, serialize_search_data
+from _search import Trie, ResultMap, ResultFlag, serialize_search_data, search_data_header_struct
 
 basedir = pathlib.Path(os.path.dirname(os.path.realpath(__file__)))/'js-test-data'
 
 # Basic error handling
 
 with open(basedir/'short.bin', 'wb') as f:
-    f.write(b'')
+    f.write(b'#'*(search_data_header_struct.size - 1))
 with open(basedir/'wrong-magic.bin', 'wb') as f:
     f.write(b'MOS\1                      ')
 with open(basedir/'wrong-version.bin', 'wb') as f: