"Fossies" - the Fresh Open Source Software Archive

Member "bashdb-5.0-1.1.0/test/unit/test-alias.sh" (5 Sep 2019, 1214 Bytes) of package /linux/privat/bashdb-5.0-1.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "test-alias.sh": 4.4-1.0.1_vs_5.0-1.1.0.

    1 #!/usr/local/bin/bash
    2 # -*- shell-script -*-
    3 test_alias()
    4 {
    5     _Dbg_alias_add u up
    6     typeset expanded_alias=''; _Dbg_alias_expand u
    7     assertEquals 'up' $expanded_alias
    8 
    9     _Dbg_alias_add q quit
   10     expanded_alias=''; _Dbg_alias_expand q
   11     assertEquals 'quit' $expanded_alias
   12 
   13     typeset aliases_found=''
   14     _Dbg_alias_find_aliased quit
   15     assertEquals 'q' "$aliases_found"
   16 
   17     _Dbg_alias_add exit quit
   18     _Dbg_alias_find_aliased quit
   19     assertEquals 'exit, q' "$aliases_found"
   20 
   21     _Dbg_alias_remove q
   22     expanded_alias=''; _Dbg_alias_expand q
   23     assertEquals 'q' $expanded_alias
   24 
   25     _Dbg_alias_find_aliased quit
   26     assertEquals 'exit' "$aliases_found"
   27 
   28     expanded_alias=''; _Dbg_alias_expand u
   29     assertEquals 'up' $expanded_alias
   30 }
   31 
   32 if [ '/src/external-vcs/sourceforge/bashdb' = '' ] ; then
   33   echo "Something is wrong: abs_top_srcdir is not set."
   34  exit 1
   35 fi
   36 abs_top_srcdir=/src/external-vcs/sourceforge/bashdb
   37 # Make sure $abs_top_src has a trailing slash
   38 abs_top_srcdir=${abs_top_srcdir%%/}/
   39 . ${abs_top_srcdir}test/unit/helper.sh
   40 . $abs_top_srcdir/lib/help.sh
   41 . $abs_top_srcdir/lib/alias.sh
   42 set -- # reset $# so shunit2 doesn't get confused.
   43 [[ $0 == ${BASH_SOURCE} ]] && . ${shunit_file}