Add partial use of comments

This commit is contained in:
PedroEdiaz
2025-06-19 22:01:03 -06:00
parent 0f76ad666a
commit 7124aeb94e
2 changed files with 10 additions and 4 deletions

View File

@@ -25,12 +25,14 @@ test_struct :: struct {
@(test)
spec_test :: proc(t: ^testing.T){
test_files := []string {
"./spec/specs/delimiters.json",
"./spec/specs/sections.json",
"./spec/specs/interpolation.json",
//"./spec/specs/inverted.json",
//"./spec/specs/partials.json",
//"./spec/specs/comments.json",
"./spec/specs/inverted.json",
"./spec/specs/comments.json",
/*
"./spec/specs/partials.json",
"./spec/specs/delimiters.json",
*/
}
for i in test_files {
@@ -45,13 +47,16 @@ spec_test :: proc(t: ^testing.T){
json.unmarshal(data, &test, allocator=context.temp_allocator)
failed := 0
for j in test.tests {
ret := mustache(j.template, j.data)
defer delete(ret)
if ret!=j.expected {
log.warnf( "[%s:%s]: %s", i, j.name, j.desc )
failed += 1
}
}
log.infof( "[%s] Passed: (%d/%d)", i, len(test.tests)-failed, len(test.tests) )
}
}