From 5db811253e0440b372b9063d8a92a98e06a39171 Mon Sep 17 00:00:00 2001 From: Eugene Sharygin Date: Mon, 16 Feb 2015 15:28:11 +0300 Subject: psub: add -s, --suffix --- tests/test9.in | 21 +++++++++++++++++++++ tests/test9.out | 3 +++ 2 files changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/test9.in b/tests/test9.in index 962fae8c..1199609b 100644 --- a/tests/test9.in +++ b/tests/test9.in @@ -97,6 +97,27 @@ else echo 'psub file was deleted' end +if count (echo foo | psub -s .cc | grep -o '\.cc$') >/dev/null + echo 'psub filename ends with .cc' +else + echo 'psub filename does not end with .cc' +end + +if count (echo foo | psub -f -s .cc | grep -o '\.cc$') >/dev/null + echo 'psub filename ends with .cc' +else + echo 'psub filename does not end with .cc' +end + +set -l filename (echo foo | psub -s .fish) +if test -e (dirname $filename) + echo 'psub directory was not deleted' +else + echo 'psub directory was deleted' +end + +diff -q (__fish_print_help psub | psub) (psub -hs banana | psub) + # Test support for unbalanced blocks function try_unbalanced_block ../fish -c "echo $argv | source " 2>&1 | grep "Missing end" 1>&2 diff --git a/tests/test9.out b/tests/test9.out index f33c85ac..8419e697 100644 --- a/tests/test9.out +++ b/tests/test9.out @@ -17,6 +17,9 @@ foo bar baz psub file was deleted +psub filename ends with .cc +psub filename ends with .cc +psub directory was deleted bom_test not#a#comment is -- cgit v1.2.3