Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
d1ba0861
Commit
d1ba0861
authored
Mar 15, 2016
by
Leo Gordon
Browse files
a new test for Utils::split_for_bash() function
parent
ffe2962e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
t/01.utils/split_for_bash.t
t/01.utils/split_for_bash.t
+38
-0
No files found.
t/01.utils/split_for_bash.t
0 → 100755
View file @
d1ba0861
#!/usr/bin/env perl
# Copyright [1999-2016] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use
strict
;
use
warnings
;
use
Test::
More
;
BEGIN
{
use_ok
(
'
Bio::EnsEMBL::Hive::Utils
',
'
split_for_bash
'
);
}
#########################
# NB: because split_for_bash() returns an ARRAY (not an ARRAYREF), we have to capture the returned value into a pair of [ ]
is_deeply
(
[
split_for_bash
('
alpha beta gamma
')
],
['
alpha
',
'
beta
',
'
gamma
'],
'
regular by-word split
');
is_deeply
(
[
split_for_bash
('
alpha "beta gamma " delta
')
],
['
alpha
',
'
beta gamma
',
'
delta
'],
'
some enclosed spaces
');
is_deeply
(
[
split_for_bash
(
q{alpha -m'beta gamma' -R"select['hello world'] and rusage['hello again']"}
)
],
['
alpha
',
'
-mbeta gamma
',
q{-Rselect['hello world'] and rusage['hello again']}
],
'
remove only the external pair of quotes
');
done_testing
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment