func TestMethodUint64ToInt32Checked(t *testing.T) {
	cases := []struct {
		o Uint64
	}{
		{MaxUint64},
	}
	for _, c := range cases {
		converted, ok := c.o.ToInt32Checked()
		if ok {
			v, ok := converted.ToUint64Checked()
			if ok {
				equal, err := v.Eq(c.o)
				if err != nil {
					t.Errorf("error checking for overflow overflow for Uint64 to Int32: %v", err)
				}
				if err != nil || !equal {
					t.Errorf("detected unhandled overflow for Uint64 to Int32 - %#v != %#v", v, c.o)
				}
			}
		}
	}
}
// In some cases we don't need to check it when there is no possible overflow
// so this test verifys that we have implemented the Checked method correctly.
In some cases we don't need to check it when there is no possible overflow
so this test verifys that we have implemented the Checked method correctly.
// In some cases we don ' t need to check it when there is no possible overflow // so this test verifys that we have implemented the Checked method correctly .
func TestMethodUint64ToInt32Checked(t *testing.T) {
	cases := []struct {
		o Uint64
	}{
		{MaxUint64},
	}
	for _, c := range cases {
		converted, ok := c.o.ToInt32Checked()
		if ok {
			v, ok := converted.ToUint64Checked()
			if ok {
				equal, err := v.Eq(c.o)
				if err != nil {
					t.Errorf("error checking for overflow overflow for Uint64 to Int32: %v", err)
				}
				if err != nil || !equal {
					t.Errorf("detected unhandled overflow for Uint64 to Int32 - %#v != %#v", v, c.o)
				}
			}
		}
	}
}
func TestMethodUint64ToInt32Checked ( t * testing . T ) { cases := [ ] struct { o Uint64 } { { MaxUint64 } , } for _ , c := range cases { converted , ok := c . o . ToInt32Checked ( ) if ok { v , ok := converted . ToUint64Checked ( ) if ok { equal , err := v . Eq ( c . o ) if err != nil { t . Errorf ( " " , err ) } if err != nil || ! equal { t . Errorf ( " " , v , c . o ) } } } } }
In some cases we don't need to check it when there is no possible overflow
so this test verifys that we have implemented the Checked method correctly.
In some cases we don ' t need to check it when there is no possible overflow so this test verifys that we have implemented the Checked method correctly .