File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 22 (:require
33 [aleph.netty :as netty]
44 [aleph.resource-leak-detector]
5- [clojure.test :refer [deftest is]]
5+ [clojure.test :refer [deftest is testing ]]
66 [manifold.stream :as s])
77 (:import
88 (io.netty.channel Channel ChannelConfig)
5454 (netty/put! channel s 6 )
5555 (is (not (-> config .isAutoRead)))))
5656
57+ (deftest sliced-bytebuf-conversion
58+ (let [s " foObar"
59+ bbuf (netty/to-byte-buf s)
60+ sbuf (.slice bbuf 2 3 )
61+ bary (netty/buf->array bbuf)
62+ sary (netty/buf->array sbuf)]
63+ (testing " Vanilla ByteBuf conversion"
64+ (is (= s (String. ^bytes bary))))
65+ (testing " Sliced ByteBuf conversion"
66+ (is (= (subs s 2 5 ) (String. ^bytes sary))))))
67+
5768(aleph.resource-leak-detector/instrument-tests! )
You can’t perform that action at this time.
0 commit comments