Add Snappy library compatibility tests
This commit is contained in:
parent
eb9e828647
commit
25b84f6488
2 changed files with 12 additions and 1 deletions
|
|
@ -8,7 +8,7 @@
|
|||
:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
|
||||
:1.5 {:dependencies [[org.clojure/clojure "1.5.0-alpha3"]]}
|
||||
:dev {:dependencies []}
|
||||
:test {:dependencies []}}
|
||||
:test {:dependencies [[org.xerial.snappy/snappy-java "1.0.5-M3"]]}}
|
||||
:aliases {"test-all" ["with-profile" "test,1.3:test,1.4:test,1.5" "test"]}
|
||||
:min-lein-version "2.0.0"
|
||||
:warn-on-reflection true)
|
||||
|
|
|
|||
|
|
@ -15,3 +15,14 @@
|
|||
(println (benchmarks/autobench))
|
||||
(println (benchmarks/autobench))
|
||||
(println (benchmarks/autobench))
|
||||
|
||||
(deftest test-snappy-library-compatibility
|
||||
(let [thaw #(nippy/thaw-from-bytes % :compressed? false)
|
||||
^bytes raw-ba (nippy/freeze-to-bytes test-data :compress? false)
|
||||
^bytes xerial-ba (org.xerial.snappy.Snappy/compress raw-ba)
|
||||
^bytes iq80-ba (org.iq80.snappy.Snappy/compress raw-ba)]
|
||||
(is (= (thaw raw-ba)
|
||||
(thaw (org.xerial.snappy.Snappy/uncompress xerial-ba))
|
||||
(thaw (org.xerial.snappy.Snappy/uncompress iq80-ba))
|
||||
(thaw (org.iq80.snappy.Snappy/uncompress iq80-ba 0 (alength iq80-ba)))
|
||||
(thaw (org.iq80.snappy.Snappy/uncompress xerial-ba 0 (alength xerial-ba)))))))
|
||||
Loading…
Reference in a new issue