Skip to content

Commit

Permalink
Merge pull request #570 from MartinFillon/improve-gen-test-dir
Browse files Browse the repository at this point in the history
test(dir_generation): Added more content to the dir generator
  • Loading branch information
cafkafk authored Oct 30, 2023
2 parents 206caaf + 4e262a6 commit 9ba9c65
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,12 @@ test_dir := "tests/test_dir"

gen_test_dir:
#!/usr/bin/env bash
rm {{test_dir}} -r;
rm {{test_dir}} -rf;
mkdir -p {{test_dir}}
cd {{test_dir}};
sudo groupadd -f eza_test

# BEGIN grid
mkdir -p grid
cd grid
Expand Down Expand Up @@ -266,6 +268,76 @@ gen_test_dir:

# END test_root

# BEGIN test_symlinks

mkdir -p symlinks
touch symlinks/file --date=@0
ln -s file symlinks/symlink
ln -s symlink symlinks/symlink2
mkdir -p symlinks/dir
ln -s dir symlinks/symlink3
ln -s pipitek symlinks/symlink4

# END test_symlinks

# BEGIN test_perms

mkdir -p perms
touch perms/file --date=@0
touch perms/file2 --date=@0
chmod 777 perms/file
chmod 001 perms/file2

# END test_perms

# BEGIN test_group
mkdir -p group
touch group/file --date=@0
sudo chgrp eza_test group/file
# END test_group

# BEGIN test_size
mkdir -p size
touch size/1M --date=@0
dd if=/dev/zero of=size/1M bs=1 count=0 seek=1M
touch size/1K --date=@0
dd if=/dev/zero of=size/1K bs=1 count=0 seek=1K
touch size/1B --date=@0
dd if=/dev/zero of=size/1B bs=1 count=0 seek=1
touch size/1337 --date=@0
dd if=/dev/zero of=size/1337 bs=1 count=0 seek=1337
# END test_size

# BEGIN test_time
mkdir -p time
touch time/epoch --date=@0
touch time/1s --date=@1
touch time/1m --date=@60
touch time/1h --date=@3600
touch time/1d --date=@86400
touch time/1y --date=@31536000
# END test_time

# BEGIN test_icons
mkdir -p icons
touch icons/file --date=@0
touch icons/go.go --date=@0
touch icons/rust.rs --date=@0
touch icons/c.c --date=@0
touch icons/c++.cpp --date=@0
touch icons/python.py --date=@0
touch icons/java.java --date=@0
touch icons/javascript.js --date=@0
touch icons/html.html --date=@0
touch icons/css.css --date=@0
touch icons/php.php --date=@0
touch icons/ruby.rb --date=@0
touch icons/shell.sh --date=@0
touch icons/unknown.unknown --date=@0
touch icons/man.1 --date=@0
touch icons/marked.md --date=@0
# END test_icons

eza -l --grid;

# Runs integration tests in nix sandbox
Expand Down

0 comments on commit 9ba9c65

Please sign in to comment.