Преглед изворни кода

Refresh extended tests

It’s clear that these hadn’t actually been run for a while, and after installing Vagrant again I had to clear out the cobwebs. Necessary changes include:

• Rust is installed differently
• Git-ignored files are now marked
• The help text changed
• Listing a directory symlink shows its contents, requiring a change to the way a directory-symlink test gets run
Benjamin Sago пре 6 година
родитељ
комит
7dada93c3e
10 измењених фајлова са 25 додато и 17 уклоњено
  1. 10 2
      Vagrantfile
  2. 1 1
      xtests/git_12
  3. 1 1
      xtests/git_2_all
  4. 1 1
      xtests/git_2_ignoreds
  5. 1 1
      xtests/git_2_long
  6. 3 3
      xtests/git_2_recurse
  7. 3 3
      xtests/git_2_tree
  8. 3 2
      xtests/help
  9. 1 2
      xtests/help_long
  10. 1 1
      xtests/run.sh

+ 10 - 2
Vagrantfile

@@ -45,8 +45,15 @@ Vagrant.configure(2) do |config|
     # This is done as vagrant, not root, because it’s vagrant
     # who actually uses it. Sent to /dev/null because the progress
     # bar produces a ton of output.
-    config.vm.provision :shell, privileged: false, inline:
-      %[hash rustc &>/dev/null || curl -sSf https://static.rust-lang.org/rustup.sh | sh &> /dev/null]
+    config.vm.provision :shell, privileged: false, inline: <<-EOF
+
+      if hash rustc &>/dev/null; then
+        echo "Rust is already installed"
+      else
+        set -xe
+        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+      fi
+    EOF
 
 
     # Use a different ‘target’ directory on the VM than on the host.
@@ -120,6 +127,7 @@ Vagrant.configure(2) do |config|
 
       # Tell bash to execute a bunch of stuff when a session starts
       echo "source /vagrant/devtools/dev-bash.sh" > /home/#{developer}/.bash_profile
+      chown #{developer} /home/#{developer}/.bash_profile
 
       # Disable last login date in sshd
       sed -i '/PrintLastLog yes/c\PrintLastLog no' /etc/ssh/sshd_config

+ 1 - 1
xtests/git_12

@@ -6,4 +6,4 @@
 /testcases/git2:
 drwxrwxr-x - cassowary  1 Jan 12:34 -N deeply
 drwxrwxr-x - cassowary  1 Jan 12:34 -N ignoreds
-drwxrwxr-x - cassowary  1 Jan 12:34 -- target
+drwxrwxr-x - cassowary  1 Jan 12:34 -I target

+ 1 - 1
xtests/git_2_all

@@ -3,7 +3,7 @@
 
 /testcases/git2/ignoreds:
 .rw-rw-r-- 0 cassowary  1 Jan 12:34 -N music.m4a
-.rw-rw-r-- 0 cassowary  1 Jan 12:34 -- music.mp3
+.rw-rw-r-- 0 cassowary  1 Jan 12:34 -I music.mp3
 drwxrwxr-x - cassowary  1 Jan 12:34 -N nested
 
 /testcases/git2/target:

+ 1 - 1
xtests/git_2_ignoreds

@@ -1,3 +1,3 @@
 .rw-rw-r-- 0 cassowary  1 Jan 12:34 -N music.m4a
-.rw-rw-r-- 0 cassowary  1 Jan 12:34 -- music.mp3
+.rw-rw-r-- 0 cassowary  1 Jan 12:34 -I music.mp3
 drwxrwxr-x - cassowary  1 Jan 12:34 -N nested

+ 1 - 1
xtests/git_2_long

@@ -1,3 +1,3 @@
 drwxrwxr-x - cassowary  1 Jan 12:34 -N deeply
 drwxrwxr-x - cassowary  1 Jan 12:34 -N ignoreds
-drwxrwxr-x - cassowary  1 Jan 12:34 -- target
+drwxrwxr-x - cassowary  1 Jan 12:34 -I target

+ 3 - 3
xtests/git_2_recurse

@@ -1,6 +1,6 @@
 drwxrwxr-x - cassowary  1 Jan 12:34 -N deeply
 drwxrwxr-x - cassowary  1 Jan 12:34 -N ignoreds
-drwxrwxr-x - cassowary  1 Jan 12:34 -- target
+drwxrwxr-x - cassowary  1 Jan 12:34 -I target
 
 /testcases/git2/deeply:
 drwxrwxr-x - cassowary  1 Jan 12:34 -N nested
@@ -18,11 +18,11 @@
 
 /testcases/git2/ignoreds:
 .rw-rw-r-- 0 cassowary  1 Jan 12:34 -N music.m4a
-.rw-rw-r-- 0 cassowary  1 Jan 12:34 -- music.mp3
+.rw-rw-r-- 0 cassowary  1 Jan 12:34 -I music.mp3
 drwxrwxr-x - cassowary  1 Jan 12:34 -N nested
 
 /testcases/git2/ignoreds/nested:
-.rw-rw-r-- 0 cassowary  1 Jan 12:34 -- 70s grove.mp3
+.rw-rw-r-- 0 cassowary  1 Jan 12:34 -I 70s grove.mp3
 .rw-rw-r-- 0 cassowary  1 Jan 12:34 -N funky chicken.m4a
 
 /testcases/git2/target:

+ 3 - 3
xtests/git_2_tree

@@ -8,9 +8,9 @@
 .rw-rw-r--  0 cassowary  1 Jan 12:34 -- │        └── subfile
 drwxrwxr-x  - cassowary  1 Jan 12:34 -N ├── ignoreds
 .rw-rw-r--  0 cassowary  1 Jan 12:34 -N │  ├── music.m4a
-.rw-rw-r--  0 cassowary  1 Jan 12:34 -- │  ├── music.mp3
+.rw-rw-r--  0 cassowary  1 Jan 12:34 -I │  ├── music.mp3
 drwxrwxr-x  - cassowary  1 Jan 12:34 -N │  └── nested
-.rw-rw-r--  0 cassowary  1 Jan 12:34 -- │     ├── 70s grove.mp3
+.rw-rw-r--  0 cassowary  1 Jan 12:34 -I │     ├── 70s grove.mp3
 .rw-rw-r--  0 cassowary  1 Jan 12:34 -N │     └── funky chicken.m4a
-drwxrwxr-x  - cassowary  1 Jan 12:34 -- └── target
+drwxrwxr-x  - cassowary  1 Jan 12:34 -I └── target
 .rw-rw-r--  0 cassowary  1 Jan 12:34 --    └── another ignored file

+ 3 - 2
xtests/help

@@ -18,9 +18,11 @@ DISPLAY OPTIONS
 FILTERING AND SORTING OPTIONS
   -a, --all                  show hidden and 'dot' files
   -d, --list-dirs            list directories like regular files
+  -L, --level DEPTH          limit the depth of recursion
   -r, --reverse              reverse the sort order
   -s, --sort SORT_FIELD      which field to sort by
   --group-directories-first  list directories before other files
+  -D, --only-dirs            list only directories
   -I, --ignore-glob GLOBS    glob patterns (pipe-separated) of files to ignore
   --git-ignore               Ignore files mentioned in '.gitignore'
   Valid sort fields:         name, Name, extension, Extension, size, type,
@@ -34,12 +36,11 @@ LONG VIEW OPTIONS
   -h, --header       add a header row to each column
   -H, --links        list each file's number of hard links
   -i, --inode        list each file's inode number
-  -L, --level DEPTH  limit the depth of recursion
   -m, --modified     use the modified timestamp field
   -S, --blocks       show number of file system blocks
   -t, --time FIELD   which timestamp field to list (modified, accessed, created)
   -u, --accessed     use the accessed timestamp field
   -U, --created      use the created timestamp field
   --time-style       how to format timestamps (default, iso, long-iso, full-iso)
-  --git              list each file's Git status, if tracked
+  --git              list each file's Git status, if tracked or ignored
   -@, --extended     list each file's extended attributes and sizes

+ 1 - 2
xtests/help_long

@@ -8,12 +8,11 @@ LONG VIEW OPTIONS
   -h, --header       add a header row to each column
   -H, --links        list each file's number of hard links
   -i, --inode        list each file's inode number
-  -L, --level DEPTH  limit the depth of recursion
   -m, --modified     use the modified timestamp field
   -S, --blocks       show number of file system blocks
   -t, --time FIELD   which timestamp field to list (modified, accessed, created)
   -u, --accessed     use the accessed timestamp field
   -U, --created      use the created timestamp field
   --time-style       how to format timestamps (default, iso, long-iso, full-iso)
-  --git              list each file's Git status, if tracked
+  --git              list each file's Git status, if tracked or ignored
   -@, --extended     list each file's extended attributes and sizes

+ 1 - 1
xtests/run.sh

@@ -175,7 +175,7 @@ COLUMNS=80 $exa $testcases/links     2>&1 | diff -q - $results/links          ||
 
 # There’ve been bugs where the target file wasn’t printed properly when the
 # symlink file was specified on the command-line directly.
-$exa $testcases/links/* -1 | diff -q - $results/links_1_files || exit 1
+$exa $testcases/links/* -1d | diff -q - $results/links_1_files || exit 1
 
 
 # Colours and terminals