28 lines
452 B
Go
28 lines
452 B
Go
package dict
|
|
|
|
import (
|
|
"os"
|
|
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
type dictDictToDictTestCase struct {
|
|
Dict1 Dict `yaml:"dict1"`
|
|
Dict2 Dict `yaml:"dict2"`
|
|
Result Dict `yaml:"result"`
|
|
}
|
|
|
|
func loadDictDictToDictTestCases(fn string) []dictDictToDictTestCase {
|
|
content, err := os.ReadFile(fn)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
var testCases []dictDictToDictTestCase
|
|
err = yaml.Unmarshal(content, &testCases)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return testCases
|
|
}
|