pi@pi-test:~/repos/rpi-wiringpi $ prove -v t/75-serial.t t/75-serial.t .. ok 1 - An object of class 'RPi::Serial' isa 'RPi::Serial' ok 2 - putc() and getc() ok not ok 3 - puts() and gets() ok # Failed test 'puts() and gets() ok' # at t/75-serial.t line 32. # got: 'hello, world!' # expected: 'hello, world!' #### use strict; use warnings; use lib 't/'; use RPiTest qw(check_pin_status); use RPi::WiringPi; use RPi::Const qw(:all); use Test::More; my $mod = 'RPi::WiringPi'; if (! $ENV{RPI_SERIAL}){ plan skip_all => "RPI_SERIAL environment variable not set\n"; } if (! $ENV{PI_BOARD}){ $ENV{NO_BOARD} = 1; plan skip_all => "Not on a Pi board\n"; } my $pi = $mod->new; my $s = $pi->serial("/dev/ttyS0", 115200); isa_ok $s, 'RPi::Serial'; $s->putc(254); is $s->getc, 254, "putc() and getc() ok"; $s->puts("hello, world!"); # FAILING TEST IS BELOW is $s->gets(13), "hello, world!", "puts() and gets() ok"; $pi->cleanup; check_pin_status(); done_testing();