     (it "fails with an error message"
       (should=
         (str "Expected 1 to be an instance of: " (-to-s (type :foo)) endl "           but was an instance of: " (-to-s (type 1)) " (using isa?)")
-        (failure-message (should-be-a (type :foo) 1))))
-
-    )
+        (failure-message (should-be-a (type :foo) 1)))))
 
   (context "should-not-be-a"
 

    (it "fails with an error message"
      (should=
        (str "Expected :bar not to be an instance of " (-to-s (type :bar)) " but was (using isa?)")
        (failure-message (should-not-be-a (type :foo) :bar))))

    )

  (context "should<"
    (it "degenerate cases"

      )
    )

  (context "should-contain"
    (it "checks for membership of precise strings"
      (should-pass! (should-contain "foo" "foobar"))
      (should-fail! (should-contain "foo" "bar"))
      (should-fail! (should-contain "foo" "Foo")))

    (it "checks for matching of regular expressions"
      (should-pass! (should-contain #"hello.*" "hello, world"))
      (should-fail! (should-contain #"hello.*" "hola!"))
      (should-pass! (should-contain #"tea" "I'm a little teapot"))
      (should-fail! (should-contain #"coffee" "I'm a little teapot")))

    (it "checks for membership of collection items"
      (should-pass! (should-contain "tea" ["i'm" "a" "little" "tea" "pot"]))
      (should-pass! (should-contain "tea" (list "i'm" "a" "little" "tea" "pot")))
      (should-pass! (should-contain "tea" (set ["i'm" "a" "little" "tea" "pot"])))
      (should-pass! (should-contain 1 [1 2 3]))
      (should-fail! (should-contain "coffee" ["i'm" "a" "little" "tea" "pot"]))
      (should-fail! (should-contain "coffee" (list "i'm" "a" "little" "tea" "pot")))
      (should-fail! (should-contain "coffee" (set ["i'm" "a" "little" "tea" "pot"]))))

    (it "checks for membership of keys"
      (should-pass! (should-contain "foo" {"foo" :bar}))
      (should-fail! (should-contain :bar {"foo" :bar}))
      (should-pass! (should-contain 1 {"foo" :bar 1 2}))
      (should-fail! (should-contain 2 {"foo" :bar 1 2})))

    (it "errors on unhandled types"
      (should-throw exception (str "should-contain doesn't know how to handle these types: [" (type-name (type 1)) " " (type-name (type 1)) "]")
                    (should-contain 1 2)))

    (it "handles nil containers gracefully"
      (should-fail! (should-contain "foo" nil))
      (should-fail! (should-contain nil nil))))

  (context "should-not-contain"
    (it "checks for non-membership of precise strings"
      (should-fail! (should-not-contain "foo" "foobar"))
      (should-pass! (should-not-contain "foo" "bar"))
      (should-pass! (should-not-contain "foo" "Foo")))

    (it "checks for non-matching of regular expressions"
      (should-fail! (should-not-contain #"hello.*" "hello, world"))
      (should-pass! (should-not-contain #"hello.*" "hola!"))
      (should-fail! (should-not-contain #"tea" "I'm a little teapot"))
      (should-pass! (should-not-contain #"coffee" "I'm a little teapot")))

    (it "checks for non-membership of collection items"
      (should-fail! (should-not-contain "tea" ["i'm" "a" "little" "tea" "pot"]))
      (should-fail! (should-not-contain "tea" (list "i'm" "a" "little" "tea" "pot")))
      (should-fail! (should-not-contain "tea" (set ["i'm" "a" "little" "tea" "pot"])))
      (should-fail! (should-not-contain 1 [1 2 3]))
      (should-pass! (should-not-contain "coffee" ["i'm" "a" "little" "tea" "pot"]))
      (should-pass! (should-not-contain "coffee" (list "i'm" "a" "little" "tea" "pot")))
      (should-pass! (should-not-contain "coffee" (set ["i'm" "a" "little" "tea" "pot"]))))

    (it "checks for non-membership of keys"
      (should-fail! (should-not-contain "foo" {"foo" :bar}))
      (should-pass! (should-not-contain :bar {"foo" :bar}))
      (should-fail! (should-not-contain 1 {"foo" :bar 1 2}))
      (should-pass! (should-not-contain 2 {"foo" :bar 1 2})))

    (it "errors on unhandled types"
      (should-throw exception (str "should-not-contain doesn't know how to handle these types: [" (type-name (type 1)) " " (type-name (type 1)) "]")
                    (should-not-contain 1 2)))

    (it "handles nil containers gracefully"
      (should-pass! (should-not-contain "foo" nil))
      (should-pass! (should-not-contain nil nil))))

  (context "should-not-be-nil"
    (it "checks for inequality with nil"
      (should-fail! (should-not-be-nil nil))
      (should-pass! (should-not-be-nil true))
      (should-pass! (should-not-be-nil false))))

  (context "should-fail"
    (it "is an automatic failure"
      (should-fail! (should-fail))
      (should= "Forced failure" (failure-message (should-fail))))

    (it "can take a string as the error message"
      (should-fail! (should-fail "some message"))
      (should= "some message" (failure-message (should-fail "some message")))))

  (context "should-start-with"
    (it "checks for prefix in strings"
      (should-pass! (should-start-with "abc" "abcdefg"))
      (should-fail! (should-start-with "abc" "ab"))
      (should-fail! (should-start-with "bcd" "abcdefg"))
      (should= (str "Expected \"abcdefg\" to start\n"
                    "    with \"bcd\"")
               (failure-message (should-start-with "bcd" "abcdefg"))))

    (it "checks for prefix in collections"
      (should-pass! (should-start-with [1 2] [1 2 3 4 5]))
      (should-fail! (should-start-with [2 3] [1 2 3 4 5]))
      (should= (str "Expected [1 2 3 4 5] to start\n"
                    "    with [2 3]")
               (failure-message (should-start-with [2 3] [1 2 3 4 5]))))

    (it "errors on unexpected types"
      (should-throw exception (str "should-start-with doesn't know how to handle these types: [" (type-name (type 1)) " " (type-name (type 1)) "]")
                    (should-start-with 1 2))))

  (context "should-not-start-with"
    (it "checks for prefix in strings"
      (should-pass! (should-not-start-with "bcd" "abcdefg"))
      (should-fail! (should-not-start-with "abc" "abcdefg"))
      (should= (str "Expected \"abcdefg\" to NOT start\n"
                    "    with \"abc\"")
               (failure-message (should-not-start-with "abc" "abcdefg"))))

    (it "checks for prefix in collections"
      (should-pass! (should-not-start-with [2 3] [1 2 3 4 5]))
      (should-fail! (should-not-start-with [1 2] [1 2 3 4 5]))
      (should= (str "Expected [1 2 3 4 5] to NOT start\n"
                    "    with [1 2]")
               (failure-message (should-not-start-with [1 2] [1 2 3 4 5]))))

    (it "errors on unexpected types"
      (should-throw exception (str "should-not-start-with doesn't know how to handle these types: [" (type-name (type 1)) " " (type-name (type 1)) "]")
                    (should-not-start-with 1 2))))

  (context "should-end-with"
    (it "checks for prefix in strings"
      (should-pass! (should-end-with "xyz" "tuvwxyz"))
      (should-fail! (should-end-with "xyz" ""))
      (should-fail! (should-end-with "wxy" "tuvwxyz"))
      (should= (str "Expected [tuvwxyz] to end\n"
                    "        with [wxy]")
               (failure-message (should-end-with "wxy" "tuvwxyz"))))

    (it "checks for prefix in collections"
      (should-pass! (should-end-with [4 5] [1 2 3 4 5]))
      (should-fail! (should-end-with [3 4] [1 2 3 4 5]))
      (should= (str "Expected [1 2 3 4 5] to end\n"
                    "          with [3 4]")
               (failure-message (should-end-with [3 4] [1 2 3 4 5]))))

    (it "errors on unexpected types"
      (should-throw exception (str "should-end-with doesn't know how to handle these types: [" (type-name (type 1)) " " (type-name (type 1)) "]")
                    (should-end-with 1 2))))

  (context "should-not-end-with"
    (it "checks for prefix in strings"
      (should-pass! (should-not-end-with "wxy" "tuvwxyz"))
      (should-fail! (should-not-end-with "xyz" "tuvwxyz"))
      (should= (str "Expected [tuvwxyz] to NOT end\n"
                    "        with [xyz]")
               (failure-message (should-not-end-with "xyz" "tuvwxyz"))))

    (it "checks for prefix in collections"
      (should-pass! (should-not-end-with [3 4] [1 2 3 4 5]))
      (should-fail! (should-not-end-with [4 5] [1 2 3 4 5]))
      (should= (str "Expected [1 2 3 4 5] to NOT end\n"
                    "          with [4 5]")
               (failure-message (should-not-end-with [4 5] [1 2 3 4 5]))))

    (it "errors on unexpected types"
      (should-throw exception (str "should-not-end-with doesn't know how to handle these types: [" (type-name (type 1)) " " (type-name (type 1)) "]")
                    (should-not-end-with 1 2))))

  (context "should-throw"
    #?(:clj
       (it "tests that any Throwable is thrown"
         (should-pass! (should-throw (throw (java.lang.Throwable. "error"))))
         (should-fail! (should-throw (+ 1 1)))
         (should= (str "Expected " (type-name java.lang.Throwable) " thrown from: (+ 1 1)" endl
                       (apply str (take (count (type-name java.lang.Throwable)) (repeat " "))) "              but got: <nothing thrown>")
                  (failure-message (should-throw (+ 1 1))))))

    (it "can test an expected throwable type"
      (should-pass! (should-throw exception (throw (-new-exception))))

      #?(:clj
         (should-pass! (should-throw java.lang.Object (throw (java.lang.Exception.)))))

      (should-fail! (should-throw exception (throw (-new-throwable))))
      (should-fail! (should-throw exception (+ 1 1)))
      (should= (str "Expected " (type-name exception) " thrown from: (+ 1 1)" endl
                    (apply str (take (count (type-name exception)) (repeat " "))) "              but got: <nothing thrown>")
               (failure-message (should-throw exception (+ 1 1))))
      #?(:cljs
         (should=
           (str "Expected nothing thrown from: " (pr-str '(throw (-new-throwable "some message"))) endl "                     but got: #object[String some message]")
           (failure-message (should-not-throw (throw (-new-throwable "some message")))))
         :clj
         (should-contain
           (str "Expected " (type-name exception) " thrown from: (throw (-new-throwable \"some message\"))" endl
                (apply str (take (count (type-name exception)) (repeat " ")))
                "              but got: #error {\n :cause \"some message\"\n :via\n [{:type java.lang.Throwable\n")
           (failure-message (should-throw exception (throw (-new-throwable "some message"))))))
      )

    (it "can test the message of the exception with regex"
      (should-pass! (should-throw exception #"[a-zA-Z]" (throw (-new-exception "my message"))))
      (should-fail! (should-throw exception #"[a-zA-Z]" (throw (-new-exception "123456")))))

    (it "can test the message of the exception"
      (should-pass! (should-throw exception "My message" (throw (-new-exception "My message"))))
      (should-fail! (should-throw exception "My message" (throw (-new-exception "Not my message"))))
      (should-fail! (should-throw exception "My message" (throw (throwable "My message"))))
      (should-fail! (should-throw exception "My message" (+ 1 1)))
      (should= (str "Expected exception predicate didn't match" endl "Expected: \"My message\"" endl "     got: \"Not my message\" (using =)")
               (failure-message (should-throw exception "My message" (throw (-new-exception "Not my message"))))))

    (it "can test an exception by calling a passed function"
      (should-pass! (should-throw exception #(empty? (speclj.platform/error-message %)) (throw (-new-exception ""))))
      (should-fail! (should-throw exception #((not (empty? (speclj.platform/error-message %))) (throw (-new-exception "")))))
      (should= (str "Expected exception predicate didn't match" endl "Expected: true" endl "     got: \"Not my message\" (using =)")
               (failure-message (should-throw exception #(speclj.platform/error-message %) (throw (-new-exception "Not my message")))))))

  (context "should-not-throw"
   (it "tests that nothing was thrown"
     (should-pass! (should-not-throw (+ 1 1)))
     (should-fail! (should-not-throw (throw (-new-throwable "error"))))
     #?(:cljs
        (should=
          (str "Expected nothing thrown from: " (pr-str '(throw (-new-throwable "error"))) endl "                     but got: #object[String error]")
          (failure-message (should-not-throw (throw (-new-throwable "error")))))
        :clj
        (should-contain
          (str "Expected nothing thrown from: " (pr-str '(throw (-new-throwable "error"))) endl
               "                     but got: #error {\n :cause \"error\"\n :via\n [{:type java.lang.Throwable\n   :message \"error\"\n")
          (failure-message (should-not-throw (throw (-new-throwable "error"))))))))


  (context "should-be-a"
