Changeset: 74ba8ae4295a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=74ba8ae4295a
Modified Files:
        common/stream/Tests/read_bz2.stable.out
        common/stream/Tests/read_gz.stable.out
        common/stream/Tests/read_lz4.stable.out
        common/stream/Tests/read_tests.py
        common/stream/Tests/read_uncompressed.stable.out
        common/stream/Tests/read_xz.stable.out
        common/stream/Tests/testdata.py
Branch: makelibstreamgreatagain
Log Message:

Add test for \r\n removal across block boundaries


diffs (97 lines):

diff --git a/common/stream/Tests/read_bz2.stable.out 
b/common/stream/Tests/read_bz2.stable.out
--- a/common/stream/Tests/read_bz2.stable.out
+++ b/common/stream/Tests/read_bz2.stable.out
@@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.bz2
 
 Test read rastream block16385_bom.txt.bz2 OK
 
+Test read rstream crlf1024.txt.bz2 OK
+
+Test read rastream crlf1024.txt.bz2 OK
+
 # 14:14:05 >  
 # 14:14:05 >  "Done."
 # 14:14:05 >  
diff --git a/common/stream/Tests/read_gz.stable.out 
b/common/stream/Tests/read_gz.stable.out
--- a/common/stream/Tests/read_gz.stable.out
+++ b/common/stream/Tests/read_gz.stable.out
@@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.gz 
 
 Test read rastream block16385_bom.txt.gz OK
 
+Test read rstream crlf1024.txt.gz OK
+
+Test read rastream crlf1024.txt.gz OK
+
 # 14:14:05 >  
 # 14:14:05 >  "Done."
 # 14:14:05 >  
diff --git a/common/stream/Tests/read_lz4.stable.out 
b/common/stream/Tests/read_lz4.stable.out
--- a/common/stream/Tests/read_lz4.stable.out
+++ b/common/stream/Tests/read_lz4.stable.out
@@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.lz4
 
 Test read rastream block16385_bom.txt.lz4 OK
 
+Test read rstream crlf1024.txt.lz4 OK
+
+Test read rastream crlf1024.txt.lz4 OK
+
 # 14:14:05 >  
 # 14:14:05 >  "Done."
 # 14:14:05 >  
diff --git a/common/stream/Tests/read_tests.py 
b/common/stream/Tests/read_tests.py
--- a/common/stream/Tests/read_tests.py
+++ b/common/stream/Tests/read_tests.py
@@ -44,6 +44,12 @@ def gen_docs():
             size = base_size + delta
             yield from gen_bom_compr_variants(f'block{size}', input, size)
 
+    # \r at end of first block, \n at start of next
+    head = (1023 * b'a') + b'\r\n' + (20 * b'b') + b'\r\n' + (20 * b'c')
+    # word of wisdom: you have to test your tests
+    assert head[:1024].endswith(b'\r')
+    assert head[1024:].startswith(b'\n')
+    yield from gen_compr_variants('crlf1024.txt', head, None)
 
 def test_read(opener, text_mode, doc):
     filename = doc.write_tmp()
diff --git a/common/stream/Tests/read_uncompressed.stable.out 
b/common/stream/Tests/read_uncompressed.stable.out
--- a/common/stream/Tests/read_uncompressed.stable.out
+++ b/common/stream/Tests/read_uncompressed.stable.out
@@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt OK
 
 Test read rastream block16385_bom.txt OK
 
+Test read rstream crlf1024.txt OK
+
+Test read rastream crlf1024.txt OK
+
 # 14:11:30 >  
 # 14:11:30 >  "Done."
 # 14:11:30 >  
diff --git a/common/stream/Tests/read_xz.stable.out 
b/common/stream/Tests/read_xz.stable.out
--- a/common/stream/Tests/read_xz.stable.out
+++ b/common/stream/Tests/read_xz.stable.out
@@ -150,6 +150,10 @@ Test read rstream block16385_bom.txt.xz 
 
 Test read rastream block16385_bom.txt.xz OK
 
+Test read rstream crlf1024.txt.xz OK
+
+Test read rastream crlf1024.txt.xz OK
+
 # 14:14:06 >  
 # 14:14:06 >  "Done."
 # 14:14:06 >  
diff --git a/common/stream/Tests/testdata.py b/common/stream/Tests/testdata.py
--- a/common/stream/Tests/testdata.py
+++ b/common/stream/Tests/testdata.py
@@ -71,7 +71,6 @@ class Doc:
         else:
             raise Exception("Unknown compression scheme: " + self.compression)
         f.write(self.content)
-        f.close()
         return filename
 
     # Read contents of the given file, decompressing appropriately
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to