mirror of
https://github.com/simon-brooke/clj-wordcloud.git
synced 2026-01-12 22:49:52 +00:00
Initial commit with the API and files
This commit is contained in:
parent
2fffddcd53
commit
48f5ddc293
12 changed files with 157 additions and 0 deletions
17
test/clj_wordcloud/core_test.clj
Normal file
17
test/clj_wordcloud/core_test.clj
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(ns clj-wordcloud.core-test
|
||||
(:require [clojure.test :refer :all]
|
||||
[clj-wordcloud.core :refer :all]))
|
||||
|
||||
|
||||
(defn get-size
|
||||
[file]
|
||||
(with-open [r (java.io.FileInputStream. file)]
|
||||
(let [image (javax.imageio.ImageIO/read r)]
|
||||
[(.getWidth image) (.getHeight image)])))
|
||||
|
||||
(deftest image-dimensions-test
|
||||
(testing "Test width and height of the generated image"
|
||||
(let [word-cloud (word-cloud (zipmap (range 100 130) (range 300))
|
||||
{:background {:type :circle :size 300}
|
||||
:filename "sample.png" :font-y 100 :padding 10})]
|
||||
(is (= (get-size "sample.png") [600 600])))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue