mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-02-10 06:18:51 +00:00
Add xtests for existing Git implementation
This commit is contained in:
parent
ff5896aad2
commit
e10c4b3eb9
31
Vagrantfile
vendored
31
Vagrantfile
vendored
@ -339,6 +339,37 @@ Vagrant.configure(2) do |config|
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# A sample Git repository
|
||||||
|
# This uses cd because it's easier than telling Git where to go each time
|
||||||
|
config.vm.provision :shell, privileged: false, inline: <<-EOF
|
||||||
|
set -xe
|
||||||
|
mkdir "#{test_dir}/git"
|
||||||
|
cd "#{test_dir}/git"
|
||||||
|
git init
|
||||||
|
|
||||||
|
mkdir edits additions moves
|
||||||
|
|
||||||
|
echo "original content" | tee edits/{staged,unstaged,both}
|
||||||
|
echo "this file gets moved" > moves/hither
|
||||||
|
|
||||||
|
git add edits moves
|
||||||
|
git commit -m "Automated test commit"
|
||||||
|
|
||||||
|
|
||||||
|
echo "modifications!" | tee edits/{staged,both}
|
||||||
|
touch additions/{staged,edited}
|
||||||
|
mv moves/{hither,thither}
|
||||||
|
|
||||||
|
git add edits moves additions
|
||||||
|
echo "more modifications!" | tee edits/unstaged edits/both additions/edited
|
||||||
|
touch additions/unstaged
|
||||||
|
|
||||||
|
|
||||||
|
touch -t #{some_date} "#{test_dir}/git/"*/*
|
||||||
|
sudo chown #{user}:#{user} -R "#{test_dir}/git"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
# Install kcov for test coverage
|
# Install kcov for test coverage
|
||||||
# This doesn’t run coverage over the xtests so it’s less useful for now
|
# This doesn’t run coverage over the xtests so it’s less useful for now
|
||||||
if ENV.key?('INSTALL_KCOV')
|
if ENV.key?('INSTALL_KCOV')
|
||||||
|
3
xtests/git_additions
Normal file
3
xtests/git_additions
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m20[0m cassowary [34m 1 Jan 12:34[0m [32mN[34mM[0m edited
|
||||||
|
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m 1 Jan 12:34[0m [32mN[38;5;244m-[0m staged
|
||||||
|
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m 1 Jan 12:34[0m [38;5;244m-[32mN[0m unstaged
|
3
xtests/git_edits
Normal file
3
xtests/git_edits
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m20[0m cassowary [34m 1 Jan 12:34[0m [34mMM[0m both
|
||||||
|
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m15[0m cassowary [34m 1 Jan 12:34[0m [34mM[38;5;244m-[0m staged
|
||||||
|
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m20[0m cassowary [34m 1 Jan 12:34[0m [38;5;244m-[34mM[0m unstaged
|
@ -101,4 +101,9 @@ COLUMNS=80 $exa $testcases/links 2>&1 | diff -q - $results/links || ex
|
|||||||
$exa $testcases/links/* -1 | diff -q - $results/links_1_files || exit 1
|
$exa $testcases/links/* -1 | diff -q - $results/links_1_files || exit 1
|
||||||
|
|
||||||
|
|
||||||
|
# Git
|
||||||
|
$exa $testcases/git/additions -l --git 2>&1 | diff -q - $results/git_additions || exit 1
|
||||||
|
$exa $testcases/git/edits -l --git 2>&1 | diff -q - $results/git_edits || exit 1
|
||||||
|
|
||||||
|
|
||||||
echo "All the tests passed!"
|
echo "All the tests passed!"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user