File: test-set0.sh.in

package info (click to toggle)
bashdb 4.0.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,820 kB
  • ctags: 942
  • sloc: sh: 10,581; lisp: 885; makefile: 449; ansic: 325
file content (25 lines) | stat: -rwxr-xr-x 574 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!@SH_PROG@
# -*- shell-script -*-

test_set0()
{
    if ! enable -f ${top_builddir}/builtin/set0 set0  >/dev/null 2>&1 ; then
	echo 'set0 tests skipped because you do not have the builtin'
	startSkipping
    fi
    typeset oldname=$0
    set0 'newname' 'bar' 2>/dev/null
    assertFalse "set0 should fail." "$?"
    set0 'newname'
    assertTrue "set0 should work this time." "$?"
    assertEquals 'newname' "$0"
    [[ $oldname != $0 ]] 
    assertTrue "old $oldname should not equal new $0" "$?"
}

# Load builtin
top_builddir=@top_builddir@

# load shunit2
. ./shunit2