Mercurial > repos > fgiacomoni > lipidmaps_textsearch
comparison t/wsdl_lmTest.t @ 0:e8bd49794291 draft
Init repository with last lipidmaps_textsearch master version
author | fgiacomoni |
---|---|
date | Tue, 11 Apr 2017 03:47:06 -0400 |
parents | |
children | 1276908e8fc4 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e8bd49794291 |
---|---|
1 #! perl | |
2 use diagnostics; | |
3 use warnings; | |
4 no warnings qw/void/; | |
5 use strict; | |
6 no strict "refs" ; | |
7 use Test::More qw( no_plan ); | |
8 #use Test::More tests => 29 ; | |
9 use FindBin ; | |
10 | |
11 ## Specific Modules | |
12 use lib $FindBin::Bin ; | |
13 my $binPath = $FindBin::Bin ; | |
14 use lib::lmTest qw( :ALL ) ; | |
15 | |
16 my $current_test = 0 ; | |
17 | |
18 print "\n\t\t\t\t * * * * * * \n" ; | |
19 print "\t * * * - - - Test LiPIDMAPS Main script - - - * * * \n\n" ; | |
20 | |
21 print "\n** Test $current_test build_lm_mass_query with no fam/class/subcl **\n" ; $current_test++; | |
22 | |
23 is( build_lm_mass_queryTest('0.5', 'NA', 'NA_1', 'NA_101'),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&ExactMassOffSet=0.5&ExactMass=', 'Works with no cat, no class and no subcl argvt' ) ; | |
24 | |
25 print "\n** Test $current_test build_lm_mass_query with a fam but no class/subcl **\n" ; $current_test++; | |
26 is( build_lm_mass_queryTest('0.5', 1, 'NA_1', 'NA_101'),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&CoreClass=1&ExactMassOffSet=0.5&ExactMass=', 'Works with a cat, but no class and no subcl argvt' ) ; | |
27 | |
28 print "\n** Test $current_test build_lm_mass_query with a fam/class but no subcl **\n" ; $current_test++; | |
29 is( build_lm_mass_queryTest('0.5', 1, 101, 'NA_101'),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&CoreClass=1&MainClass=101&ExactMassOffSet=0.5&ExactMass=', 'Works with a cat, a class but no subcl argvt' ) ; | |
30 | |
31 print "\n** Test $current_test build_lm_mass_query with a fam/class/subcl **\n" ; $current_test++; | |
32 is( build_lm_mass_queryTest('0.5', 1, 101, 10101),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&CoreClass=1&MainClass=101&SubClass=10101&ExactMassOffSet=0.5&ExactMass=', 'Works with a cat, a class and a subcl argvt' ) ; | |
33 | |
34 print "\n** Test $current_test round_nums with a list of float and a decimal reduction of 1 **\n" ; $current_test++; | |
35 is_deeply( round_numsTest( | |
36 ['175.01', '238.19', '420.16', '780.32', '956.25', '1100.45' ], 1 ), | |
37 ['175.0', '238.2', '420.2', '780.3', '956.2', '1100.5' ], | |
38 'Method \'round_nums\' works with a list of float and return a well rounded list'); | |
39 | |
40 print "\n** Test $current_test round_nums with a list of float and a decimal reduction of 0 **\n" ; $current_test++; | |
41 is_deeply( round_numsTest( | |
42 ['175.01', '238.19', '420.16', '780.32', '956.25', '1100.45', '111.6' ], 0 ), | |
43 ['175', '238', '420', '780', '956', '1100', '112' ], | |
44 'Method \'round_nums\' works with a list of float and return a well rounded list'); | |
45 | |
46 | |
47 | |
48 | |
49 |