Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: van-clj/zetta-river
base: dd215a14cc
...
head fork: van-clj/zetta-river
compare: 7fc69fd5ea
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 38 additions and 2 deletions.
  1. +2 −2 project.clj
  2. +36 −0 test/river/test/zetta.clj
View
4 project.clj
@@ -1,7 +1,7 @@
-(defproject org.van-clj/zetta-river "0.0.4-SNAPSHOT"
+(defproject org.van-clj/zetta-river "0.0.4"
:description "Integration between the river library and the
zetta-parser library"
:author "Roman Gonzalez"
:dependencies [[org.clojure/clojure "1.3.0"]
- [org.van-clj/river "0.1.1"]
+ [org.van-clj/river "0.1.2"]
[org.van-clj/zetta-parser "0.0.3"]])
View
36 test/river/test/zetta.clj
@@ -20,6 +20,11 @@
(is (= [403 2 75 99 1024] (:result result)))
(is (= river/eof (:remainder result)))))
+(deftest test-parse-consumer-with-small-chunks
+ (let [result (river/run (produce-seq 1 (seq "403 2 75 99 1024"))
+ (parse numbers))]
+ (is (= [403 2 75 99 1024] (:result result)))
+ (is (= river/eof (:remainder result)))))
(deftest test-parse*-filter
(let [result (river/run (river/p* (produce-seq (seq "403 2 75 99 1024"))
@@ -28,3 +33,34 @@
consume)]
(is (= [403 2 75 99 1024] (:result result)))
(is (= river/eof (:remainder result)))))
+
+(deftest test-parse*-filter-with-small-chunks
+ (let [result (river/run (river/p* (produce-seq 1 (seq "403 2 75 99 1024"))
+ (parse* numbers)
+ (mapcat* identity))
+ consume)]
+ (is (= [403 2 75 99 1024] (:result result)))
+ (is (= river/eof (:remainder result)))))
+
+(deftest test-parse*-filter-with-multiple-producers
+ (let [result (river/run (river/p*
+ (river/p* (produce-seq (seq "403 2 75 99 1024"))
+ (parse* numbers))
+ (mapcat* identity))
+ (river/p*
+ (river/p* (produce-seq (seq "42 43 44"))
+ (parse* numbers))
+ (mapcat* identity))
+ consume)]
+ (is (= [42 43 44 403 2 75 99 1024] (:result result)))
+ (is (= river/eof (:remainder result)))))
+
+(deftest test-parse*-filter-with-multiple-producers
+ (let [result (river/run (river/p* (produce-seq (seq "403"))
+ (parse* number))
+ (river/p* (produce-seq (seq "42"))
+ (parse* number))
+ consume)]
+ (is (= [42 403] (:result result)))
+ (is (= river/eof (:remainder result)))))
+

No commit comments for this range

Something went wrong with that request. Please try again.