add test for max int64 validator

This commit is contained in:
2026-02-12 22:40:20 +00:00
parent 08682c35c1
commit cb0d6c1d3a
2 changed files with 44 additions and 5 deletions

View File

@@ -58,12 +58,14 @@ func (t *Int64ComponentInstance) Value() interface{} {
func (t *Int64ComponentInstance) FromJSON(component block.Component, data json.RawMessage) error {
var s int64
err := json.Unmarshal(data, &s)
if err != nil {
return fmt.Errorf("Error unmarshalling property %s: %w", component.Identifier(), err)
}
t.value = s
if data != nil {
err := json.Unmarshal(data, &s)
if err != nil {
return err
}
t.value = s
}
for _, v := range component.Validators() {
if err := v(s); err != nil {