diff --git a/test/clj_jtwig/functions_test.clj b/test/clj_jtwig/functions_test.clj index 46b0f37..c6a7408 100644 --- a/test/clj_jtwig/functions_test.clj +++ b/test/clj_jtwig/functions_test.clj @@ -257,6 +257,7 @@ (is (true? (function-exists? "blank_if_null"))) (is (true? (function-exists? "butlast"))) (is (true? (function-exists? "dump"))) + (is (true? (function-exists? "dump_table"))) (is (true? (function-exists? "nth"))) (is (true? (function-exists? "max"))) (is (true? (function-exists? "min"))) @@ -287,6 +288,10 @@ (is (= (render "{{ a|dump }}" {:a [{:foo "bar"} [1, 2, 3] "hello"]}) "({\"foo\" \"bar\"} (1 2 3) \"hello\")\n"))) + (testing "dump_table" + (is (= (render "{{ t|dump_table }}", {:t [{:a 1 :b 2 :c 3} {:b 5 :a 7 :c "dog"}]}) + "\n| b | c | a |\n|---+-----+---|\n| 2 | 3 | 1 |\n| 5 | dog | 7 |\n"))) + (testing "nth" (is (= (render "{{ [1, 2, 3, 4, 5]|nth(2) }}" nil) "3"))