// 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 TestMethodFloat32ToBooleanChecked(t *testing.T) {
	cases := []struct {
		o Float32
	}{
		{MaxFloat32},
	}
	for _, c := range cases {
		converted, ok := c.o.ToBooleanChecked()
		if !ok {
			t.Errorf("Boolean should not be returning an overflow: %#v $%v", converted, c.o)
		}
		if converted != Boolean(true) {
			t.Errorf("Boolean should have been converted to Boolean(true): %#v $%v", converted, c.o)
		}
	}
}
func TestMethodFloat32ToBooleanChecked ( t * testing . T ) { cases := [ ] struct { o Float32 } { { MaxFloat32 } , } for _ , c := range cases { converted , ok := c . o . ToBooleanChecked ( ) if ! ok { t . Errorf ( " " , converted , c . o ) } if converted != Boolean ( true ) { t . Errorf ( " " , converted , 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 .