140625.5 · 0eef7cbee8286807a0ce1ada1029c21b1ef0c0c8
Add test cases for a big file.
reading declarations
Changes to tests/big/create_big_file.py. All files
@@ -0,0 +1,29 @@+#!/usr/bin/env python++# Create an 8GB file of mostly "abcdefghijklmnopqrstuvwxyz01234",+# with a few instances of "hello"++import sys++if len(sys.argv) != 2:+ print("Usage: %s big_file.txt" % sys.argv[0])+ sys.exit(1)++big_file = sys.argv[1]+++def create_big_file():+ with open(big_file, "w") as fd:+ for i in range(1, 2**28):+ byte = i * 32+ if byte % 2**30 == 0:+ fd.write("hello%s\n" % byte)+ else:+ fd.write("abcdefghijklmnopqrstuvwxyz01234\n")+ fd.write("hello\n")+++try:+ fd = open(big_file, "r")+except Exception as e:+ create_big_file()