1 module tests.asserts; 2 3 4 private 5 { 6 import djinja.djinja; 7 } 8 9 10 void assertRender(T...)(string tmpl, string expected) 11 { 12 auto result = renderData!(T)(tmpl); 13 assert(expected == result, "Expected `"~expected~"`, got `"~result~"`"); 14 } 15 16 17 18 void assertException(T...)(string tmpl) 19 { 20 try 21 renderData!(T)(tmpl); 22 catch (Exception e) 23 return; 24 assert(0, "Exception throw was expected"); 25 }