add normalize_space
This commit is contained in:
parent
a45bb27479
commit
d807f45091
|
@ -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 " ")))}
|
||||
|
|
|
@ -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"))
|
||||
|
|
Reference in a new issue