expr/t_module-register_test.go

32 lines
746 B
Go

// Copyright (c) 2024 Celestino Amoroso (celestino.amoroso@gmail.com).
// All rights reserved.
// t_module-register_test.go
package expr
import (
"testing"
)
func TestIterateModules(t *testing.T) {
section := "Module-Register"
mods := make([]string, 0, 100)
IterateModules(func(name, description string, imported bool) bool {
mods = append(mods, name)
return true
})
t.Logf("%s -- IterateModules(): %v", section, mods)
if len(mods) == 0 {
t.Errorf("Module-List: got-length zero, expected-length greater than zero")
}
// IterateModules(func(name, description string, imported bool) bool {
// return false
// })
// if len(mods) > 0 {
// t.Errorf("Module-List: got-length greater than zero, expected-length zero")
// }
}