Write some file-type integration tests

This commit is contained in:
Ben S 2016-10-29 19:25:07 +01:00
parent a7e3456b0d
commit 9589496aac
3 changed files with 64 additions and 0 deletions

39
Vagrantfile vendored
View File

@ -63,6 +63,45 @@ Vagrant.configure("2") do |config|
touch -t #{some_date} "#{test_dir}/files/"*
EOF
# File name extension testcases.
config.vm.provision :shell, privileged: false, inline: <<-EOF
set -xe
mkdir "#{test_dir}/file-types"
touch "#{test_dir}/file-types/Makefile"
touch "#{test_dir}/file-types/image.png"
touch "#{test_dir}/file-types/image.svg"
touch "#{test_dir}/file-types/video.avi"
touch "#{test_dir}/file-types/video.wmv"
touch "#{test_dir}/file-types/music.mp3"
touch "#{test_dir}/file-types/music.ogg"
touch "#{test_dir}/file-types/lossless.flac"
touch "#{test_dir}/file-types/lossless.wav"
touch "#{test_dir}/file-types/crypto.asc"
touch "#{test_dir}/file-types/crypto.signature"
touch "#{test_dir}/file-types/document.pdf"
touch "#{test_dir}/file-types/document.xlsx"
touch "#{test_dir}/file-types/compressed.zip"
touch "#{test_dir}/file-types/compressed.tar.gz"
touch "#{test_dir}/file-types/backup~"
touch "#{test_dir}/file-types/#SAVEFILE#"
touch "#{test_dir}/file-types/file.tmp"
touch "#{test_dir}/file-types/compiled.class"
touch "#{test_dir}/file-types/compiled.o"
touch "#{test_dir}/file-types/compiled.js"
touch "#{test_dir}/file-types/compiled.coffee"
EOF
# Awkward symlink testcases.
config.vm.provision :shell, privileged: false, inline: <<-EOF
set -xe

22
xtests/file-types Normal file
View File

@ -0,0 +1,22 @@
#SAVEFILE#
Makefile
backup~
compiled.class
compiled.coffee
compiled.js
compiled.o
compressed.tar.gz
compressed.zip
crypto.asc
crypto.signature
document.pdf
document.xlsx
file.tmp
image.png
image.svg
lossless.flac
lossless.wav
music.mp3
music.ogg
video.avi
video.wmv

View File

@ -43,5 +43,8 @@ $exa $testcases/passwd -lgh | diff -q - $results/passwd || exit 1
# Permissions
$exa $testcases/permissions -lghR 2>&1 | diff -q - $results/permissions || exit 1
# File types
$exa $testcases/file-types -1 2>&1 | diff -q - $results/file-types || exit 1
echo "All the tests passed!"