threatgrid / asami

A graph store for Clojure and ClojureScript
Eclipse Public License 1.0
637 stars 29 forks source link

Remove CLJS ByteBuffer from test code #102

Open quoll opened 3 years ago

quoll commented 3 years ago

The ClojureScript code in test/asami/durable/codec-test includes a stub class for ByteBuffer. This indicates that some of the Clojure tests were too heavily oriented at the underlying implementation without appropriate #?(:clj) wrappers.

The Block protocol was explicitly created to avoid anything like this being made. The existence of that protocol is a failure if a reimplementation of ByteBuffer exists.

https://github.com/threatgrid/asami/blob/73447338cc19cc06cee924077d67cb0d95c5ac48/test/asami/durable/codec_test.cljc#L46

noprompt commented 3 years ago

I'm in agreement here.

The Block protocol was explicitly created to avoid anything like this being made. The existence of that protocol is a failure if a reimplementation of ByteBuffer exists.

I should point out that at the time this code was added Block did not exist.