Blame tests/netrw-plugin-delete-command-broken/runtest.sh

Andrei Stepanov 81473c
#!/bin/bash
Andrei Stepanov 81473c
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
Andrei Stepanov 81473c
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
#   runtest.sh of /CoreOS/vim/Regression/netrw-plugin-delete-command-broken
Andrei Stepanov 81473c
#   Description: Test for netrw plugin: delete command broken
Andrei Stepanov 81473c
#   Author: Petr Splichal <psplicha@redhat.com>
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
#   Copyright (c) 2009 Red Hat, Inc. All rights reserved.
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
#   This copyrighted material is made available to anyone wishing
Andrei Stepanov 81473c
#   to use, modify, copy, or redistribute it subject to the terms
Andrei Stepanov 81473c
#   and conditions of the GNU General Public License version 2.
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
#   This program is distributed in the hope that it will be
Andrei Stepanov 81473c
#   useful, but WITHOUT ANY WARRANTY; without even the implied
Andrei Stepanov 81473c
#   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Andrei Stepanov 81473c
#   PURPOSE. See the GNU General Public License for more details.
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
#   You should have received a copy of the GNU General Public
Andrei Stepanov 81473c
#   License along with this program; if not, write to the Free
Andrei Stepanov 81473c
#   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Andrei Stepanov 81473c
#   Boston, MA 02110-1301, USA.
Andrei Stepanov 81473c
#
Andrei Stepanov 81473c
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Andrei Stepanov 81473c
Andrei Stepanov 81473c
# Include rhts environment
Andrei Stepanov 81473c
. /usr/bin/rhts-environment.sh
Andrei Stepanov 81473c
. /usr/share/rhts-library/rhtslib.sh
Andrei Stepanov 81473c
Andrei Stepanov 81473c
PACKAGE="vim-enhanced"
Andrei Stepanov 81473c
Andrei Stepanov 81473c
rlJournalStart
Andrei Stepanov 81473c
    rlPhaseStartSetup
Andrei Stepanov 81473c
        rlAssertRpm $PACKAGE
Andrei Stepanov 81473c
        rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
Andrei Stepanov 81473c
        rlRun "pushd $TmpDir"
Andrei Stepanov 81473c
        # create test file & dir
Andrei Stepanov 81473c
        rlRun "touch testfile" 0 "Creating test file"
Andrei Stepanov 81473c
        rlRun "mkdir testdir" 0 "Creating test directory"
Andrei Stepanov 81473c
        rlAssertExists "testfile"
Andrei Stepanov 81473c
        rlAssertExists "testdir"
Andrei Stepanov 81473c
        # create vim scripts
Andrei Stepanov 81473c
        rlRun "echo '/testfile
Dy
:q' > scriptfile" \
Andrei Stepanov 81473c
                0 "Creating file delete script"
Andrei Stepanov 81473c
        rlRun "echo '/testdir
Dy
:q' > scriptdir" \
Andrei Stepanov 81473c
                0 "Creating directory delete script"
Andrei Stepanov 81473c
    rlPhaseEnd
Andrei Stepanov 81473c
Andrei Stepanov 81473c
    rlPhaseStartTest
Andrei Stepanov 81473c
        rlRun "vim . -s scriptfile" 0 "Deleting file using netrw"
Andrei Stepanov 81473c
        rlAssertNotExists "testfile"
Andrei Stepanov 81473c
        rlRun "vim . -s scriptdir" 0 "Deleting directory using netrw"
Andrei Stepanov 81473c
        rlAssertNotExists "testdir"
Andrei Stepanov 81473c
    rlPhaseEnd
Andrei Stepanov 81473c
Andrei Stepanov 81473c
    rlPhaseStartCleanup
Andrei Stepanov 81473c
        rlRun "popd"
Andrei Stepanov 81473c
        rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
Andrei Stepanov 81473c
    rlPhaseEnd
Andrei Stepanov 81473c
rlJournalPrintText
Andrei Stepanov 81473c
rlJournalEnd