Mercurial > hg > Gears > Gears
changeset 691:98b9636e279e
add Util.t
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 21 Aug 2020 15:44:14 +0900 |
parents | a2483a5bd633 |
children | 3d959f470c8b |
files | src/parallel_execution/perlTests/Util.t |
diffstat | 1 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parallel_execution/perlTests/Util.t Fri Aug 21 15:44:14 2020 +0900 @@ -0,0 +1,25 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use FindBin; + +use Test::More tests => 2; #subtests + +use_ok "Gears::Util"; #use test + +use Gears::Util; + +subtest 'file_checking' => sub { + plan tests => 3; + + eval { Gears::Util->file_checking("nonexistent_file.c") }; + ok $@; + like( $@, qr/invalid filepath/ ); + + my $exists_file = "$FindBin::Bin/README.md"; + my $found_file = Gears::Util->file_checking($exists_file); + is $found_file, $exists_file; +}; + + +done_testing;