2024-06-01 16:31:50 +02:00
|
|
|
// 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)
|
2024-06-09 10:28:51 +02:00
|
|
|
IterateBuiltinModules(func(name, description string, imported bool) bool {
|
2024-06-01 16:31:50 +02:00
|
|
|
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")
|
|
|
|
// }
|
|
|
|
}
|