Add partial use of comments
This commit is contained in:
13
testing.odin
13
testing.odin
@@ -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) )
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user