(ns com.hypirion.smallex.test.lexer
  (:require [clojure.java.io :as io]
            [clojure.pprint :refer [pprint]])
  (:use [clojure.test])
  (:import (com.hypirion.smallex SMLXLexer)))

(deftest test-read
  (with-open [rdr (io/reader (io/resource "clojure.smlx"))]
    (is (try
          (doall (iterator-seq (SMLXLexer. rdr)))
          true
          (catch Exception _ false)))))

(ns com.hypirion.smallex.test.lexer
  (:require [clojure.java.io :as io]
            [clojure.pprint :refer [pprint]])
  (:use [clojure.test])
  (:import (com.hypirion.smallex SMLXLexer)))

(deftest test-read
  (with-open [rdr (io/reader (io/resource "clojure.smlx"))]
    (is (not-any? #(= :error (:type %)) (iterator-seq (SMLXLexer. rdr))))))

Check for error items in SMLXLexer test.
Check for error items in SMLXLexer test.

The SMLXLexer doesn't throw any exceptions, but return error items.

hyPiRion/smallex