Closed HenryGeorgist closed 2 years ago
wrote a test:
func Test_OccupancyType_COM1(t *testing.T) {
o := com1()
fmt.Println(o.ComponentDamageFunctions["contents"].DamageFunctions[hazards.Depth].Source)
b, err := json.Marshal(o)
if err != nil {
panic(err)
}
var o2 OccupancyTypeStochastic
err = json.Unmarshal(b, &o2)
if err != nil {
panic(err)
}
fmt.Println(o2.ComponentDamageFunctions["contents"].DamageFunctions[hazards.Depth].Source)
}
unmarshal is the culprit.
was splitting on "," rather than ", "
Describe the bug I observed that i get different damage functions from the Damage function family in testing for the same hazard parameter.
It seems that compound parameters may not behave exactly as expected.
To Reproduce Steps to reproduce the behavior:
Expected behavior either the dictionary is being improperly loaded - or the dictionary query on multiple hazards is improper.