1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Add minimum documentation to some functions

This commit is contained in:
JanHoefelmeyer 2023-09-25 11:15:01 +02:00
parent b14d775422
commit b06c316ee0

View file

@ -63,9 +63,10 @@ func TestParse(t *testing.T) {
if _, _, err := p.Parse(); err == nil { if _, _, err := p.Parse(); err == nil {
t.Errorf("Failure: Invalid path expanded.") t.Errorf("Failure: Invalid path expanded.")
} }
// fmt.Println(p.Parse())
} }
// TestFindConfigFile tests if findConfigFile() correctly finds existing and
// doesn't find nonexisting config files
func TestFindConfigFile(t *testing.T) { func TestFindConfigFile(t *testing.T) {
locations := []string{"data/config.toml"} locations := []string{"data/config.toml"}
notLocation := []string{"notomllocation"} notLocation := []string{"notomllocation"}
@ -83,6 +84,7 @@ func TestFindConfigFile(t *testing.T) {
} }
} }
// TestLoadToml tests if loadTOML() can correctly load TOML files
func TestLoadToml(t *testing.T) { func TestLoadToml(t *testing.T) {
var cfg config var cfg config
if err := loadTOML(&cfg, "data/nonexistant.toml"); err.Error() != "open "+ if err := loadTOML(&cfg, "data/nonexistant.toml"); err.Error() != "open "+