diff --git a/platforms/raspi/pwm_pin_test.go b/platforms/raspi/pwm_pin_test.go index 8a96770b..f9ecf428 100644 --- a/platforms/raspi/pwm_pin_test.go +++ b/platforms/raspi/pwm_pin_test.go @@ -1,6 +1,7 @@ package raspi import ( + "errors" "testing" "gobot.io/x/gobot/gobottest" @@ -33,6 +34,10 @@ func TestPwmPin(t *testing.T) { dc, _ = pin.DutyCycle() gobottest.Assert(t, dc, uint32(10000)) + gobottest.Assert(t, pin.SetDutyCycle(999999999), errors.New("Duty cycle exceeds period.")) + dc, _ = pin.DutyCycle() + gobottest.Assert(t, dc, uint32(10000)) + // call currently fails in test gobottest.Refute(t, pin.Unexport(), nil) } diff --git a/platforms/raspi/raspi_adaptor_test.go b/platforms/raspi/raspi_adaptor_test.go index 42c4116a..52a7df15 100644 --- a/platforms/raspi/raspi_adaptor_test.go +++ b/platforms/raspi/raspi_adaptor_test.go @@ -147,6 +147,10 @@ func TestAdaptorDigitalIO(t *testing.T) { fs.WithReadError = true _, err := a.DigitalRead("13") gobottest.Assert(t, err, errors.New("read error")) + + fs.WithWriteError = true + _, err = a.DigitalRead("7") + gobottest.Assert(t, err, errors.New("write error")) } func TestAdaptorI2c(t *testing.T) {