the_silver_searcher/tests/one_device.t
Geoff Greer de7ee68c66 Merge pull request #867 from me-and/bad-echo
Use printf in place of echo in tests
2016-04-13 21:43:24 -07:00

26 lines
671 B
Perl

Setup:
$ . $TESTDIR/setup.sh
> if [ ! -e "/dev/shm" ]; then
> echo "No /dev/shm. Skipping test."
> exit 80
> elif [ "$(stat -c%d /dev/)" = "$(stat -c%d /dev/shm/)" ]; then
> echo "/dev/shm not a different device. Skipping test."
> exit 80
> fi
$ TEST_TMPDIR=`mktemp -d --tmpdir=/dev/shm ag_test.XXX`
$ printf "blah\n" > $TEST_TMPDIR/blah.txt
$ ln -s $TEST_TMPDIR other_device
Should not descend into /dev/shm symlink when --one-device specified:
$ ag -f --one-device blah .
[1]
Files on other devices work the same way as anything else without --one-device:
$ ag -f blah .
other_device/blah.txt:1:blah
Cleanup:
$ rm -r $TEST_TMPDIR