diff --git a/Vagrantfile b/Vagrantfile index 99e789b..9f732a2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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 diff --git a/xtests/file-types b/xtests/file-types new file mode 100644 index 0000000..b895601 --- /dev/null +++ b/xtests/file-types @@ -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 diff --git a/xtests/run.sh b/xtests/run.sh index 18d998e..27caaf4 100755 --- a/xtests/run.sh +++ b/xtests/run.sh @@ -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!"