add normalize_space

This commit is contained in:
Gered 2014-03-23 11:31:35 -04:00
parent a45bb27479
commit d807f45091
2 changed files with 8 additions and 0 deletions

View file

@ -64,6 +64,10 @@
(apply min (first numbers))
(apply min numbers)))}
"normalize_space"
{:fn (fn [s]
(StringUtils/normalizeSpace s))}
"pad_left"
{:fn (fn [s size & [padding-string]]
(StringUtils/leftPad s size (or padding-string " ")))}

View file

@ -326,6 +326,10 @@
(is (= (render "{{ min(2, 1, 5, 3, 4) }}" nil)
"1")))
(testing "normalize_space"
(is (= (render "{{ normalize_space(' hello world ') }}" nil)
"hello world")))
(testing "pad_left"
(is (= (render "{{ pad_left('bat', 5) }}" nil)
" bat"))