Browse Source

修改测试

yjp 7 months ago
parent
commit
b918fe92ef
1 changed files with 4 additions and 2 deletions
  1. 4 2
      yaml/yaml_loader/yaml_loader_test.go

+ 4 - 2
yaml/yaml_loader/yaml_loader_test.go

@@ -76,8 +76,9 @@ func TestLoadYAML(t *testing.T) {
 func TestLoadYAMLMap(t *testing.T) {
 func TestLoadYAMLMap(t *testing.T) {
 	retObjectMaps := make([]map[string]any, 0)
 	retObjectMaps := make([]map[string]any, 0)
 
 
-	err := LoadYamlMapFile("test.yaml", func(objectMap map[string]any) {
+	err := LoadYamlMapFile("test.yaml", func(objectMap map[string]any) error {
 		retObjectMaps = append(retObjectMaps, objectMap)
 		retObjectMaps = append(retObjectMaps, objectMap)
+		return nil
 	})
 	})
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
@@ -98,8 +99,9 @@ func TestLoadYAMLMap(t *testing.T) {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
 
 
-	err = LoadYamlMapBytes(yamlFileBytes, func(objectMap map[string]any) {
+	err = LoadYamlMapBytes(yamlFileBytes, func(objectMap map[string]any) error {
 		retObjectMaps = append(retObjectMaps, objectMap)
 		retObjectMaps = append(retObjectMaps, objectMap)
+		return nil
 	})
 	})
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)