Back

as-str (clj)

(source)

function

(as-str & xs)
Converts its arguments into a string using [[to-str]].

Examples

hiccup
(ns hiccup.util_test
  (:require [clojure.test :refer :all]
            [hiccup.util :refer :all])
  (:import java.net.URI))

(deftest test-as-str
  (is (= (as-str "foo") "foo"))
  (is (= (as-str :foo) "foo"))
  (is (= (as-str 100) "100"))
  (is (= (as-str 4/3) (str (float 4/3))))
  (is (= (as-str "a" :b 3) "ab3"))
  (is (= (as-str (URI. "/foo")) "/foo"))
  (is (= (as-str (URI. "localhost:3000/foo")) "localhost:3000/foo")))
weavejester/hiccup
(ns hiccup.util_test
  (:require [clojure.test :refer :all]
            [hiccup.util :refer :all])
  (:import java.net.URI))

(deftest test-as-str
  (is (= (as-str "foo") "foo"))
  (is (= (as-str :foo) "foo"))
  (is (= (as-str 100) "100"))
  (is (= (as-str 4/3) (str (float 4/3))))
  (is (= (as-str "a" :b 3) "ab3"))
  (is (= (as-str (URI. "/foo")) "/foo"))
  (is (= (as-str (URI. "localhost:3000/foo")) "localhost:3000/foo")))