Skip to content

Commit

Permalink
don't explode when tested with clojure 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hiredman committed Mar 24, 2013
1 parent d3bd025 commit 0fa20ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
File renamed without changes.
15 changes: 11 additions & 4 deletions test/opennlp/test/sample.clj
@@ -1,14 +1,21 @@
(ns opennlp.test.sample
(:require [clojure.test :refer :all]
[opennlp.sample :refer [clojure-document-sample-stream]])
(:use [clojure.test]
[opennlp.sample])
(:import (opennlp.tools.doccat DocumentSample)))

(use-fixtures :once
(fn [f]
(when (and (>= (:major *clojure-version*) 1)
(or (> (:major *clojure-version*) 1)
(> (:minor *clojure-version*) 3)))
(f))))

(deftest test-samples-round-trip
(let [d #opennlp/sample {:category "foo" :text ["bar"]}]
(let [d (DocumentSample. "foo" "bar")]
(is (= d (read-string (pr-str d))))))

(deftest test-clojure-document-sample-stream
(let [d #opennlp/sample {:category "foo" :text ["bar"]}
(let [d (DocumentSample. "foo" "bar")
x (java.io.ByteArrayInputStream.
(.getBytes
(with-out-str
Expand Down

0 comments on commit 0fa20ee

Please sign in to comment.