Skip to content

Instantly share code, notes, and snippets.

@petdance
Created May 15, 2017 21:51
Show Gist options
  • Save petdance/141b4f91ee7507b62ce45e7dc23a3e5d to your computer and use it in GitHub Desktop.
Save petdance/141b4f91ee7507b62ce45e7dc23a3e5d to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Test::Tester;
use Test::More tests => 1;
use TW::Test::More;
#check_test( sub { is_fs_custnum( 'GARBAGECRAP' ) }, { ok => 0 }, 'Garbage should fail' );
is_fs_custnum( 'GARBAGECRAP' );
prove -r -I/home/alester/tw/Lib --source=Perl --ext=.t --source=PHP --php-option=include_path=/home/alester/tw/Class:/home/alester/tw/Include --php-option=extension=.phpt --ext=.phpt foo.t -v
[16:51:12] foo.t ..
1..1
# Subtest: is_fs_custnum()
1..3
ok 1 - First seven digits is a normal custnum.
not ok 2 - Last part is exactly three digits...
# Failed test 'Last part is exactly three digits...'
# at /home/alester/tw/Lib/TW/Test/More.pm line 879.
# 'CRAP'
# doesn't match '(?^:^\d{3}$)'
ok 3 - ... and is not 000.
# Looks like you failed 1 test of 3.
not ok 1 - is_fs_custnum()
# Failed test 'is_fs_custnum()'
# at foo.t line 13.
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
[16:51:12]
Test Summary Report
-------------------
foo.t (Wstat: 256 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 1
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.13 cusr 0.01 csys = 0.17 CPU)
Result: FAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment