1#!@SH_PROG@
2# -*- shell-script -*-
3
4# Test that we are saving and restoring POSIX variables IFS and PS4 that
5# the debugger changes.
6test_save_restore_IFS_PS4()
7{
8    typeset  _Dbg_space_IFS=' '
9    typeset old_IFS="$IFS"
10    typeset _Dbg_old_set_opts=$-
11    typeset new_ifs=' 	'
12    _Dbg_old_set_nullglob=1
13    IFS="$new_ifs"
14    PS4='123'
15    _Dbg_set_debugger_entry
16    assertEquals "$_Dbg_space_IFS" "$IFS"
17    assertNotEquals '123' "$PS4"
18    _Dbg_set_to_return_from_debugger 0
19    assertNotEquals "$_Dbg_space_IFS" "$IFS"
20    assertEquals "$new_ifs" "$IFS"
21    IFS="$old_IFS"
22}
23
24abs_top_srcdir=@abs_top_srcdir@
25# Make sure $abs_top_srcdir has a trailing slash
26abs_top_srcdir=${abs_top_srcdir%%/}/
27. ${abs_top_srcdir}test/unit/helper.sh
28. ${abs_top_srcdir}/init/pre.sh
29. ${abs_top_srcdir}/lib/journal.sh
30. ${abs_top_srcdir}/lib/filecache.sh
31. ${abs_top_srcdir}/lib/file.sh
32. ${abs_top_srcdir}/lib/save-restore.sh
33set -- # reset $# so shunit2 doesn't get confused.
34
35[[ @CMDLINE_INVOKED@ ]] && . ${shunit_file}
36