MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / test_tests

Function test_tests

subprojects/llama.cpp/tests/test-jinja.cpp:853–1087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851}
852
853static void test_tests(testing & t) {
854 test_template(t, "is odd",
855 "{% if 3 is odd %}yes{% endif %}",
856 json::object(),
857 "yes"
858 );
859
860 test_template(t, "is even",
861 "{% if 4 is even %}yes{% endif %}",
862 json::object(),
863 "yes"
864 );
865
866 test_template(t, "is false",
867 "{{ 'yes' if x is false }}",
868 {{"x", false}},
869 "yes"
870 );
871
872 test_template(t, "is true",
873 "{{ 'yes' if x is true }}",
874 {{"x", true}},
875 "yes"
876 );
877
878 test_template(t, "string is false",
879 "{{ 'yes' if x is false else 'no' }}",
880 {{"x", ""}},
881 "no"
882 );
883
884 test_template(t, "is divisibleby",
885 "{{ 'yes' if x is divisibleby(2) }}",
886 {{"x", 2}},
887 "yes"
888 );
889
890 test_template(t, "is eq",
891 "{{ 'yes' if 3 is eq(3) }}",
892 json::object(),
893 "yes"
894 );
895
896 test_template(t, "is not equalto",
897 "{{ 'yes' if 3 is not equalto(4) }}",
898 json::object(),
899 "yes"
900 );
901
902 test_template(t, "is ge",
903 "{{ 'yes' if 3 is ge(3) }}",
904 json::object(),
905 "yes"
906 );
907
908 test_template(t, "is gt",
909 "{{ 'yes' if 3 is gt(2) }}",
910 json::object(),

Callers

nothing calls this directly

Calls 1

test_templateFunction · 0.85

Tested by

no test coverage detected