Repository: milesgranger/cramjam (language: python)

Issue:
Compatibility tests with variants
We're asserting the roundtrip data returns as original, and only done during manual testing that output from de/compression is compatible with original variants, but these should be their own tests.

ie
```python
import gzip
import cramjam

data = b"some bytes"
assert gzip.decompress(cramjam.gzip.compress(data)) == data
assert cramjam.gzip.decompress(gzip.compress(data)) == data
```


Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index 7fc0e2b8..dbee1f69 100644
--- a/.gitignore
+++ b/.gitignore
@@ -136,3 +136,4 @@ dmypy.json
 #Added by cargo
 
 /target
+.vscode/
diff --git a/benchmark-requirements.txt b/benchmark-requirements.txt
index 5059b39c..6f994b48 100644
--- a/benchmark-requirements.txt
+++ b/benchmark-requirements.txt
@@ -3,5 +3,6 @@ python-snappy==0.5.4
 lz4==3.1.0
 brotlipy==0.7.0
 zstd==1.5.0.2
+isal==0.11.1
 numpy
 memory-profiler
diff --git a/benchmarks/README.md b/benchmarks/README.md
index 1fc6b100..bc79abdd 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -37,38 +37,55 @@ we automatically estimate the buffer size and can resize the `bytearray` after.
 
 `make bench-gzip`
 
+(spoiler alert, although cramjam is generally faster than the builtin gzip module, you should pretty much always use [igzip](https://github.com/pycompression/python-isal) when possible.)
+
 ```bash 
-------------------------------------------------------------------------------------------------------------------- benchmark: 28 tests -------------------------------------------------------------------------------------------------------------------
-Name (time in us)                                           Min                       Max                      Mean                  StdDev                    Median                     IQR            Outliers         OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-test_gzip[Mark.Twain-Tom.Sawyer.txt-cramjam]           499.5080 (1.0)            728.4359 (1.0)            512.5226 (1.0)           18.5201 (1.0)            502.8080 (1.0)           19.4933 (1.0)        208;63  1,951.1333 (1.0)        1469           1
-test_gzip[Mark.Twain-Tom.Sawyer.txt-gzip]              574.5530 (1.15)           800.9881 (1.10)           590.6570 (1.15)          20.6061 (1.11)           579.6610 (1.15)          21.3466 (1.10)       204;62  1,693.0301 (0.87)       1384           1
-test_gzip[alice29.txt-cramjam]                      10,784.0190 (21.59)       11,725.0331 (16.10)       11,019.1375 (21.50)        159.9243 (8.64)        10,992.1545 (21.86)        139.6049 (7.16)         17;7     90.7512 (0.05)         90           1
-test_gzip[alice29.txt-gzip]                         11,856.6670 (23.74)       12,723.6000 (17.47)       12,117.6208 (23.64)        154.9040 (8.36)        12,090.8240 (24.05)        148.3495 (7.61)         14;5     82.5245 (0.04)         81           1
-test_gzip[asyoulik.txt-cramjam]                      8,255.5760 (16.53)        8,808.0181 (12.09)        8,388.3462 (16.37)         89.2145 (4.82)         8,374.5810 (16.66)        102.5778 (5.26)         30;4    119.2130 (0.06)        119           1
-test_gzip[asyoulik.txt-gzip]                         9,073.6510 (18.17)        9,783.6760 (13.43)        9,242.8460 (18.03)        109.5283 (5.91)         9,221.6395 (18.34)        117.2170 (6.01)         23;5    108.1918 (0.06)        106           1
-test_gzip[fifty-four-mb-random-cramjam]          1,918,547.3130 (>1000.0)  2,281,174.9650 (>1000.0)  2,015,150.7522 (>1000.0)  151,686.4135 (>1000.0)  1,968,377.9971 (>1000.0)  140,688.2324 (>1000.0)       1;1      0.4962 (0.00)          5           1
-test_gzip[fifty-four-mb-random-gzip]             1,665,076.1690 (>1000.0)  1,747,323.1020 (>1000.0)  1,705,157.4009 (>1000.0)   29,886.1207 (>1000.0)  1,704,222.0499 (>1000.0)   35,055.7323 (>1000.0)       2;0      0.5865 (0.00)          5           1
-test_gzip[fifty-four-mb-repeating-cramjam]         202,266.0240 (404.93)     203,656.1889 (279.58)     202,876.8688 (395.84)       586.9810 (31.69)      202,665.2470 (403.07)       976.8272 (50.11)         2;0      4.9291 (0.00)          5           1
-test_gzip[fifty-four-mb-repeating-gzip]            406,177.8371 (813.16)     408,499.9190 (560.79)     406,954.2060 (794.02)       941.9838 (50.86)      406,857.7340 (809.17)     1,182.0850 (60.64)         1;0      2.4573 (0.00)          5           1
-test_gzip[fireworks.jpeg-cramjam]                    3,925.8640 (7.86)         5,138.1841 (7.05)         4,011.1756 (7.83)         110.0326 (5.94)         3,984.3025 (7.92)          83.2741 (4.27)        20;11    249.3035 (0.13)        246           1
-test_gzip[fireworks.jpeg-gzip]                       3,184.8371 (6.38)         3,616.7459 (4.97)         3,262.3774 (6.37)          59.6370 (3.22)         3,251.3360 (6.47)          72.2620 (3.71)         62;8    306.5249 (0.16)        302           1
-test_gzip[geo.protodata-cramjam]                     1,572.8211 (3.15)         1,828.2511 (2.51)         1,610.3785 (3.14)          36.8006 (1.99)         1,599.6840 (3.18)          44.1979 (2.27)       101;18    620.9720 (0.32)        609           1
-test_gzip[geo.protodata-gzip]                        2,136.3030 (4.28)         2,421.2720 (3.32)         2,184.2864 (4.26)          51.3550 (2.77)         2,165.2665 (4.31)          64.8794 (3.33)        64;14    457.8154 (0.23)        436           1
-test_gzip[html-cramjam]                              1,950.0050 (3.90)         2,314.5130 (3.18)         2,001.8077 (3.91)          46.9272 (2.53)         1,987.3570 (3.95)          61.8350 (3.17)        81;12    499.5485 (0.26)        480           1
-test_gzip[html-gzip]                                 2,466.7480 (4.94)         4,897.7289 (6.72)         2,561.2299 (5.00)         230.8277 (12.46)        2,516.4341 (5.00)          77.6293 (3.98)        10;18    390.4374 (0.20)        391           1
-test_gzip[html_x_4-cramjam]                          9,295.9950 (18.61)       10,382.4440 (14.25)        9,466.6361 (18.47)        166.3815 (8.98)         9,422.9169 (18.74)        134.9731 (6.92)         12;9    105.6341 (0.05)        107           1
-test_gzip[html_x_4-gzip]                            10,916.7770 (21.86)       11,705.1441 (16.07)       11,102.0056 (21.66)        138.3860 (7.47)        11,072.2100 (22.02)        140.6029 (7.21)         17;4     90.0738 (0.05)         86           1
-test_gzip[kppkn.gtb-cramjam]                        38,534.4781 (77.14)       39,374.4000 (54.05)       38,952.7990 (76.00)        200.1030 (10.80)       38,965.1706 (77.50)        238.4051 (12.23)         7;0     25.6721 (0.01)         26           1
-test_gzip[kppkn.gtb-gzip]                           62,682.8249 (125.49)      64,644.2850 (88.74)       63,360.6900 (123.63)       646.7011 (34.92)       63,061.5850 (125.42)       938.3130 (48.14)         4;0     15.7827 (0.01)         16           1
-test_gzip[lcet10.txt-cramjam]                       26,310.1180 (52.67)       27,208.7040 (37.35)       26,565.8054 (51.83)        223.3611 (12.06)       26,516.8336 (52.74)        235.3310 (12.07)        10;3     37.6424 (0.02)         38           1
-test_gzip[lcet10.txt-gzip]                          29,205.7050 (58.47)       30,147.2150 (41.39)       29,597.1343 (57.75)        193.6721 (10.46)       29,561.2030 (58.79)        219.0185 (11.24)         5;2     33.7871 (0.02)         32           1
-test_gzip[paper-100k.pdf-cramjam]                    2,809.4910 (5.62)         3,251.7480 (4.46)         2,873.6302 (5.61)          51.4007 (2.78)         2,861.0771 (5.69)          55.6436 (2.85)        50;15    347.9919 (0.18)        343           1
-test_gzip[paper-100k.pdf-gzip]                       3,216.7250 (6.44)         3,755.8790 (5.16)         3,286.1528 (6.41)          71.3635 (3.85)         3,266.0410 (6.50)          74.8790 (3.84)        37;12    304.3072 (0.16)        298           1
-test_gzip[plrabn12.txt-cramjam]                     47,907.7781 (95.91)       50,276.0150 (69.02)       48,341.7333 (94.32)        489.6980 (26.44)       48,157.5651 (95.78)        338.0665 (17.34)         1;1     20.6861 (0.01)         21           1
-test_gzip[plrabn12.txt-gzip]                        52,439.5080 (104.98)      55,409.8539 (76.07)       53,299.8328 (104.00)       872.4323 (47.11)       53,018.4830 (105.44)     1,305.1905 (66.96)         4;0     18.7618 (0.01)         19           1
-test_gzip[urls.10K-cramjam]                         35,436.3660 (70.94)       36,588.2240 (50.23)       35,778.6046 (69.81)        306.0787 (16.53)       35,707.5301 (71.02)        246.1017 (12.62)         6;3     27.9497 (0.01)         27           1
-test_gzip[urls.10K-gzip]                            40,238.6910 (80.56)       41,588.8891 (57.09)       40,757.2876 (79.52)        266.3417 (14.38)       40,718.7125 (80.98)        206.5550 (10.60)         3;3     24.5355 (0.01)         24           1
+------------------------------------------------------------------------------------------------------------------ benchmark: 42 tests -------------------------------------------------------------------------------------------------------------------
+Name (time in us)                                           Min                       Max                      Mean                 StdDev                    Median                    IQR            Outliers          OPS            Rounds  Iterations
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+test_gzip[Mark.Twain-Tom.Sawyer.txt-cramjam]           191.8590 (3.44)           459.5510 (2.67)           232.3503 (3.49)         42.3918 (4.45)           216.2325 (3.43)         23.9335 (3.31)      505;534   4,303.8455 (0.29)       3484           1
+test_gzip[Mark.Twain-Tom.Sawyer.txt-gzip]              230.9320 (4.14)         1,348.3770 (7.83)           278.0395 (4.17)         56.0642 (5.89)           259.9420 (4.12)         29.7642 (4.11)      410;435   3,596.6108 (0.24)       2899           1
+test_gzip[Mark.Twain-Tom.Sawyer.txt-isal]               55.8100 (1.0)            172.2580 (1.0)             66.6014 (1.0)           9.5214 (1.0)             63.0650 (1.0)           7.2408 (1.0)       854;539  15,014.6976 (1.0)        6917           1
+test_gzip[alice29.txt-cramjam]                       2,289.4180 (41.02)        3,586.7580 (20.82)        2,531.1701 (38.00)       205.3819 (21.57)        2,481.5745 (39.35)       106.6280 (14.73)       32;33     395.0742 (0.03)        320           1
+test_gzip[alice29.txt-gzip]                          2,746.6730 (49.21)        5,784.2850 (33.58)        3,128.5895 (46.97)       352.9359 (37.07)        3,018.4270 (47.86)       258.2175 (35.66)       39;29     319.6329 (0.02)        320           1
+test_gzip[alice29.txt-isal]                            630.2320 (11.29)        2,712.9960 (15.75)          692.1121 (10.39)        92.0883 (9.67)           673.7130 (10.68)        25.5560 (3.53)       70;159   1,444.8527 (0.10)       1288           1
+test_gzip[asyoulik.txt-cramjam]                      2,031.5850 (36.40)        3,478.0610 (20.19)        2,246.2740 (33.73)       215.1429 (22.60)        2,193.3480 (34.78)       107.9130 (14.90)       30;39     445.1817 (0.03)        387           1
+test_gzip[asyoulik.txt-gzip]                         2,336.2790 (41.86)        3,485.5790 (20.23)        2,547.9955 (38.26)       173.5410 (18.23)        2,504.1120 (39.71)       113.7950 (15.72)       34;29     392.4654 (0.03)        354           1
+test_gzip[asyoulik.txt-isal]                           514.5240 (9.22)         1,400.8010 (8.13)           599.2456 (9.00)         73.4877 (7.72)           574.7005 (9.11)         71.0005 (9.81)       190;82   1,668.7649 (0.11)       1256           1
+test_gzip[fifty-four-mb-random-cramjam]          1,211,255.6200 (>1000.0)  1,257,472.9720 (>1000.0)  1,237,629.0870 (>1000.0)  17,775.0203 (>1000.0)  1,241,997.1640 (>1000.0)  24,676.1108 (>1000.0)       2;0       0.8080 (0.00)          5           1
+test_gzip[fifty-four-mb-random-gzip]             1,095,648.4620 (>1000.0)  1,110,366.0260 (>1000.0)  1,103,719.8038 (>1000.0)   6,105.5552 (641.24)   1,102,582.1870 (>1000.0)   9,973.5320 (>1000.0)       2;0       0.9060 (0.00)          5           1
+test_gzip[fifty-four-mb-random-isal]               168,541.5770 (>1000.0)    212,197.5160 (>1000.0)    181,629.0707 (>1000.0)  15,576.1286 (>1000.0)    177,291.2230 (>1000.0)   7,280.1230 (>1000.0)       1;1       5.5057 (0.00)          6           1
+test_gzip[fifty-four-mb-repeating-cramjam]         134,944.4950 (>1000.0)    181,172.1680 (>1000.0)    153,997.7280 (>1000.0)  19,735.0671 (>1000.0)    142,841.9530 (>1000.0)  36,666.9240 (>1000.0)       2;0       6.4936 (0.00)          7           1
+test_gzip[fifty-four-mb-repeating-gzip]            126,086.2200 (>1000.0)    144,891.1680 (841.13)     132,237.1890 (>1000.0)   6,698.9614 (703.57)     129,553.7330 (>1000.0)   9,267.9080 (>1000.0)       2;0       7.5622 (0.00)          8           1
+test_gzip[fifty-four-mb-repeating-isal]            104,930.9420 (>1000.0)    110,588.2970 (641.99)     107,397.2519 (>1000.0)   1,882.4948 (197.71)     107,018.3145 (>1000.0)   3,244.9360 (448.15)        4;0       9.3112 (0.00)         10           1
+test_gzip[fireworks.jpeg-cramjam]                    2,272.0720 (40.71)        3,841.4350 (22.30)        2,544.0224 (38.20)       226.1681 (23.75)        2,484.9960 (39.40)       189.9015 (26.23)       30;18     393.0783 (0.03)        344           1
+test_gzip[fireworks.jpeg-gzip]                       2,033.2690 (36.43)        3,293.9500 (19.12)        2,261.8599 (33.96)       128.4785 (13.49)        2,230.3385 (35.37)        83.7080 (11.56)       68;38     442.1140 (0.03)        410           1
+test_gzip[fireworks.jpeg-isal]                         557.8950 (10.00)          922.6780 (5.36)           639.2987 (9.60)         53.6616 (5.64)           638.0545 (10.12)        79.6670 (11.00)      318;19   1,564.2139 (0.10)       1058           1
+test_gzip[geo.protodata-cramjam]                       543.6170 (9.74)         3,331.8180 (19.34)          683.1062 (10.26)       164.7324 (17.30)          653.2410 (10.36)        73.8828 (10.20)     137;148   1,463.9011 (0.10)       1507           1
+test_gzip[geo.protodata-gzip]                          746.4350 (13.37)        3,485.2950 (20.23)          832.4478 (12.50)       108.8803 (11.44)          815.1780 (12.93)        51.7680 (7.15)        48;66   1,201.2765 (0.08)       1016           1
+test_gzip[geo.protodata-isal]                          325.9980 (5.84)         1,716.9900 (9.97)           360.5302 (5.41)         43.9673 (4.62)           350.1455 (5.55)         18.2805 (2.52)      183;239   2,773.6924 (0.18)       2228           1
+test_gzip[html-cramjam]                                559.0320 (10.02)        1,007.0500 (5.85)           652.3441 (9.79)         62.2105 (6.53)           644.8590 (10.23)        58.2925 (8.05)        95;39   1,532.9332 (0.10)        800           1
+test_gzip[html-gzip]                                   733.5640 (13.14)        1,239.4010 (7.20)           814.8288 (12.23)        61.7839 (6.49)           795.7915 (12.62)        60.2950 (8.33)       138;44   1,227.2517 (0.08)        912           1
+test_gzip[html-isal]                                   293.4400 (5.26)         1,077.9470 (6.26)           320.2257 (4.81)         31.3367 (3.29)           312.7960 (4.96)         17.4120 (2.40)      113;117   3,122.7978 (0.21)       1680           1
+test_gzip[html_x_4-cramjam]                          2,680.6610 (48.03)        5,121.8420 (29.73)        2,949.2002 (44.28)       183.4686 (19.27)        2,922.4515 (46.34)        90.8240 (12.54)       31;29     339.0750 (0.02)        326           1
+test_gzip[html_x_4-gzip]                             3,140.6020 (56.27)        6,755.7770 (39.22)        3,438.3153 (51.63)       334.5340 (35.13)        3,389.2870 (53.74)       178.4918 (24.65)       13;16     290.8401 (0.02)        249           1
+test_gzip[html_x_4-isal]                             1,145.9080 (20.53)        5,369.5510 (31.17)        1,333.4371 (20.02)       263.7536 (27.70)        1,255.0020 (19.90)       128.4425 (17.74)       75;95     749.9417 (0.05)        693           1
+test_gzip[kppkn.gtb-cramjam]                         2,272.2560 (40.71)        3,975.8810 (23.08)        2,460.3480 (36.94)       138.0943 (14.50)        2,439.8625 (38.69)        80.1670 (11.07)       35;31     406.4466 (0.03)        378           1
+test_gzip[kppkn.gtb-gzip]                            2,737.3670 (49.05)        4,541.3070 (26.36)        2,997.0626 (45.00)       208.5254 (21.90)        2,938.9400 (46.60)       126.3835 (17.45)       36;29     333.6600 (0.02)        327           1
+test_gzip[kppkn.gtb-isal]                              620.2470 (11.11)        1,438.9580 (8.35)           694.6918 (10.43)        77.9132 (8.18)           664.6515 (10.54)        36.2180 (5.00)      118;136   1,439.4872 (0.10)       1038           1
+test_gzip[lcet10.txt-cramjam]                        6,515.5340 (116.74)      10,480.1160 (60.84)        7,804.9459 (117.19)    1,293.0755 (135.81)       7,175.8955 (113.79)    2,331.5930 (322.01)       34;0     128.1239 (0.01)        138           1
+test_gzip[lcet10.txt-gzip]                           7,590.8110 (136.01)      14,044.3360 (81.53)        8,259.7372 (124.02)      803.4726 (84.39)        8,047.0785 (127.60)      407.9500 (56.34)         9;9     121.0692 (0.01)        120           1
+test_gzip[lcet10.txt-isal]                           1,798.1930 (32.22)        3,801.2430 (22.07)        2,001.5485 (30.05)       216.8714 (22.78)        1,937.9530 (30.73)       107.5470 (14.85)       40;47     499.6132 (0.03)        390           1
+test_gzip[paper-100k.pdf-cramjam]                    1,574.2830 (28.21)        4,883.8400 (28.35)        1,773.2297 (26.62)       189.1485 (19.87)        1,735.9090 (27.53)        65.1753 (9.00)        27;45     563.9427 (0.04)        541           1
+test_gzip[paper-100k.pdf-gzip]                       1,876.8750 (33.63)        4,374.8760 (25.40)        2,054.1447 (30.84)       168.2990 (17.68)        2,019.5360 (32.02)        87.6453 (12.10)       30;33     486.8206 (0.03)        443           1
+test_gzip[paper-100k.pdf-isal]                         421.2930 (7.55)         3,587.9140 (20.83)          483.5627 (7.26)        113.1682 (11.89)          464.7290 (7.37)         43.4210 (6.00)        50;90   2,067.9842 (0.14)       1359           1
+test_gzip[plrabn12.txt-cramjam]                      8,824.4760 (158.12)      12,236.2950 (71.03)        9,246.9970 (138.84)      499.8499 (52.50)        9,109.3310 (144.44)      171.8368 (23.73)         7;7     108.1432 (0.01)         75           1
+test_gzip[plrabn12.txt-gzip]                        10,067.7340 (180.39)      14,851.2830 (86.22)       10,705.5403 (160.74)      849.3527 (89.20)       10,398.4875 (164.89)      414.7850 (57.28)         9;9      93.4096 (0.01)         90           1
+test_gzip[plrabn12.txt-isal]                         1,997.3020 (35.79)        3,128.8200 (18.16)        2,267.3735 (34.04)       257.9910 (27.10)        2,136.7485 (33.88)       234.7265 (32.42)       74;52     441.0389 (0.03)        396           1
+test_gzip[urls.10K-cramjam]                          9,862.8800 (176.72)      14,844.7900 (86.18)       10,724.2182 (161.02)    1,308.2085 (137.40)      10,164.5780 (161.18)      576.2437 (79.58)       10;14      93.2469 (0.01)         91           1
+test_gzip[urls.10K-gzip]                            10,704.3820 (191.80)      13,596.6140 (78.93)       11,235.3842 (168.70)      542.1322 (56.94)       11,038.5890 (175.04)      338.8595 (46.80)         9;9      89.0045 (0.01)         81           1
+test_gzip[urls.10K-isal]                             2,942.9670 (52.73)        7,301.6880 (42.39)        3,212.3236 (48.23)       316.5106 (33.24)        3,136.4275 (49.73)       149.9830 (20.71)       21;28     311.3011 (0.02)        276           1
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ```
 
 #### Snappy
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 41155ea2..37d4dc39 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,4 +1,4 @@
-black==21.5b1
+black==22.3.0
 maturin
 numpy
 pytest>=5.3.0
diff --git a/src/io.rs b/src/io.rs
index 8413e108..c6168385 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -350,7 +350,7 @@ impl RustyFile {
 /// b'bytes'
 /// ```
 ///
-#[pyclass(name = "Buffer")]
+#[pyclass(subclass, name = "Buffer")]
 #[derive(Default)]
 pub struct RustyBuffer {
     pub(crate) inner: Cursor<Vec<u8>>,


Test patch:
diff --git a/benchmarks/test_bench.py b/benchmarks/test_bench.py
index 0bd7c10b..79074973 100644
--- a/benchmarks/test_bench.py
+++ b/benchmarks/test_bench.py
@@ -121,27 +121,35 @@ def test_cramjam_snappy_de_compress_into(benchmark, op, file):
     )
 
 
-@pytest.mark.parametrize(
-    "use_cramjam", (True, False), ids=lambda val: "cramjam" if val else "gzip"
-)
+@pytest.mark.parametrize("lib", ("gzip", "cramjam", "isal"), ids=lambda val: val)
 @pytest.mark.parametrize("file", FILES, ids=lambda val: val.name)
-def test_gzip(benchmark, file, use_cramjam: bool):
+def test_gzip(benchmark, file, lib):
+    from isal import igzip
+
     data = file.read_bytes()
-    if use_cramjam:
+    if lib == "cramjam":
         benchmark(
             round_trip,
             compress=cramjam.gzip.compress,
             decompress=cramjam.gzip.decompress,
             data=data,
-            level=9,
+            level=3,
         )
-    else:
+    elif lib == "gzip":
         benchmark(
             round_trip,
             compress=gzip.compress,
             decompress=gzip.decompress,
             data=data,
-            compresslevel=9,
+            compresslevel=3,
+        )
+    else:
+        benchmark(
+            round_trip,
+            compress=igzip.compress,
+            decompress=igzip.decompress,
+            data=data,
+            compresslevel=igzip._COMPRESS_LEVEL_BEST,  # 3
         )
 
 
diff --git a/tests/data/integration/plaintext.txt b/tests/data/integration/plaintext.txt
new file mode 100644
index 00000000..634c12ba
--- /dev/null
+++ b/tests/data/integration/plaintext.txt
@@ -0,0 +1,21 @@
+The Zen of Python, by Tim Peters
+
+Beautiful is better than ugly.
+Explicit is better than implicit.
+Simple is better than complex.
+Complex is better than complicated.
+Flat is better than nested.
+Sparse is better than dense.
+Readability counts.
+Special cases aren't special enough to break the rules.
+Although practicality beats purity.
+Errors should never pass silently.
+Unless explicitly silenced.
+In the face of ambiguity, refuse the temptation to guess.
+There should be one-- and preferably only one --obvious way to do it.
+Although that way may not be obvious at first unless you're Dutch.
+Now is better than never.
+Although never is often better than *right* now.
+If the implementation is hard to explain, it's a bad idea.
+If the implementation is easy to explain, it may be a good idea.
+Namespaces are one honking great idea -- let's do more of those!
diff --git a/tests/data/integration/plaintext.txt.br b/tests/data/integration/plaintext.txt.br
new file mode 100644
index 00000000..bee3bdeb
Binary files /dev/null and b/tests/data/integration/plaintext.txt.br differ
diff --git a/tests/data/integration/plaintext.txt.bz2 b/tests/data/integration/plaintext.txt.bz2
new file mode 100644
index 00000000..2709945f
Binary files /dev/null and b/tests/data/integration/plaintext.txt.bz2 differ
diff --git a/tests/data/integration/plaintext.txt.gz b/tests/data/integration/plaintext.txt.gz
new file mode 100644
index 00000000..3076ce0e
Binary files /dev/null and b/tests/data/integration/plaintext.txt.gz differ
diff --git a/tests/data/integration/plaintext.txt.lz4 b/tests/data/integration/plaintext.txt.lz4
new file mode 100644
index 00000000..4e721fd8
Binary files /dev/null and b/tests/data/integration/plaintext.txt.lz4 differ
diff --git a/tests/data/integration/plaintext.txt.snappy b/tests/data/integration/plaintext.txt.snappy
new file mode 100644
index 00000000..cd447a1a
Binary files /dev/null and b/tests/data/integration/plaintext.txt.snappy differ
diff --git a/tests/data/integration/plaintext.txt.zst b/tests/data/integration/plaintext.txt.zst
new file mode 100644
index 00000000..b2782cf0
Binary files /dev/null and b/tests/data/integration/plaintext.txt.zst differ
diff --git a/tests/test_integration.py b/tests/test_integration.py
new file mode 100644
index 00000000..02ebfbbd
--- /dev/null
+++ b/tests/test_integration.py
@@ -0,0 +1,41 @@
+"""
+Test decompressing files which have been compressed from 
+main stream third party implementations, separate from this project.
+"""
+import sys
+import pathlib
+from collections import namedtuple
+
+import pytest
+import cramjam
+
+
+@pytest.fixture
+def integration_dir():
+    return pathlib.Path(__file__).parent.joinpath("data/integration")
+
+
+@pytest.fixture
+def plaintext(integration_dir):
+    return integration_dir.joinpath("plaintext.txt").read_bytes()
+
+
+Variant = namedtuple("Variant", ("name", "suffix"))
+
+
+@pytest.mark.skipif(sys.platform.startswith("win"), reason="Bytes comparison fails on windows")
+@pytest.mark.parametrize(
+    "variant",
+    (
+        Variant("gzip", "gz"),
+        Variant("bzip2", "bz2"),
+        Variant("zstd", "zst"),
+        Variant("brotli", "br"),
+        Variant("lz4", "lz4"),
+        Variant("snappy", "snappy"),
+    ),
+)
+def test_variant(variant: Variant, integration_dir: pathlib.Path, plaintext: bytes):
+    file = integration_dir.joinpath(f"plaintext.txt.{variant.suffix}")
+    decompress = getattr(cramjam, variant.name).decompress
+    assert bytes(decompress(file.read_bytes())) == plaintext