Lines 858-871
subtest 'store check barcodes' => sub {
Link Here
|
858 |
); |
858 |
); |
859 |
|
859 |
|
860 |
$item->barcode("")->store(); |
860 |
$item->barcode("")->store(); |
861 |
is( $item->barcode, undef, 'Empty string barcodes are treated as undef'); |
861 |
$item->discard_changes; |
|
|
862 |
is( $item->barcode, undef, 'Empty string barcodes are treated as undef' ); |
862 |
|
863 |
|
863 |
$item->barcode("123456789")->store(); |
864 |
$item->barcode("123456789")->store(); |
864 |
is( $item->barcode, "123456789", 'Non-empty string barcodes are unchanged'); |
865 |
$item->discard_changes; |
|
|
866 |
is( $item->barcode, "123456789", 'Non-empty string barcodes are unchanged' ); |
865 |
|
867 |
|
866 |
$item->barcode(undef)->store(); |
868 |
$item->barcode(undef)->store(); |
867 |
is( $item->barcode, undef, 'undef barcodes remain undef'); |
869 |
$item->discard_changes; |
|
|
870 |
is( $item->barcode, undef, 'undef barcodes remain undef' ); |
868 |
}; |
871 |
}; |
|
|
872 |
|
869 |
subtest 'deletion' => sub { |
873 |
subtest 'deletion' => sub { |
870 |
plan tests => 15; |
874 |
plan tests => 15; |
871 |
|
875 |
|
872 |
- |
|
|