Permalink
Browse files

Added some malformed test cases

  • Loading branch information...
1 parent 2e69e95 commit 873aec16fbdd7f585a836766e9a8355ae38ae72d @alexgartrell committed Apr 13, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/tnetstrings/test/core.clj
@@ -37,6 +37,13 @@
(is (= "25:3:foo,3:bar,3:biz,4:bang,}"
(dumps {"foo" "bar" "biz" "bang"})))))
+;; This needs a lot of work, both here and in the actual core, we pretty much
+;; puke whenever something has a bad prefix length
+(deftest malformed-loads
+ (is (= :NOTMATCHED (loads "3:foo!")))
+ (is (= :NOTMATCHED (loads "6:3:foo!]")))
+ (is (= :NOTMATCHED (loads "10:1:1#3:foo!]"))))
+
(defn roundtrip-item [item]
(is (= item (loads (dumps item)))))

0 comments on commit 873aec1

Please sign in to comment.