1. 20 8月, 2017 1 次提交
    • B
      Fix an error being displayed weirdly · 4c16f505
      Benjamin Sago 提交于
      The Debug impl was being used instead of the Display one. Also, remove the full stops from the ends of all the error messages because I’ve decided it looks weird.
      4c16f505
  2. 19 8月, 2017 1 次提交
  3. 11 8月, 2017 3 次提交
    • B
      Hide xattr errors unless --extended · 5189d66e
      Benjamin Sago 提交于
      exa now ignores errors when checking for extended attributes when the user didn’t explicitly demand that they be checked. If a file does have xattrs, it’ll still display the @ in the permissions column; errors will now just cause the @ to be hidden instead.
      
      This changed a lot of the xtests, which were displaying the error message in a few situations. Those tests have gained @-suffixed companions so the actual error messages can still be tested.
      
      Fixes #178 (finally)
      5189d66e
    • B
      Add actual error messages for the error messages · b2866766
      Benjamin Sago 提交于
      The annoying part is trying to format!() an OsStr.
      b2866766
    • B
      Integrate strict mode, use it to test file sizes · adaa36e1
      Benjamin Sago 提交于
      It’s a good test to be able to switch strict mode on in run.sh and not have it break anything! Now, the EXA_STRICT environment variable will toggle it on. We can even switch it off and see that it doesn’t error.
      adaa36e1
  4. 07 8月, 2017 1 次提交
    • B
      Test the locale month name width stuff · 115315a0
      Benjamin Sago 提交于
      This commit modifies a specific file timestamp so we test both July (which is 5 characters in French) and December (which is 4 characters in Japanese). It’s also kind of a test for locales as well.
      115315a0
  5. 06 8月, 2017 1 次提交
  6. 27 7月, 2017 1 次提交
    • B
      Switch to the new options parser · 2d1f462b
      Benjamin Sago 提交于
      This commit removes the dependency on the ‘getopts’ crate entirely, and re-writes all its uses to use the new options parser instead.
      
      As expected there are casualties galore:
      
      - We now need to collect the options into a vector at the start, so we can use references to them, knowing they’ll be stored *somewhere*.
      - Because OsString isn’t Display, its Debug impl gets used instead. (This is hopefully temporary)
      - Options that take values (such as ‘sort’ or ‘time-style’) now parse those values with ‘to_string_lossy’. The ‘lossy’ part means “I’m at a loss for what to do here”
      - Error messages got a lot worse, but “--tree --all --all” is now a special case of error rather than just another Misfire::Useless.
      - Some tests had to be re-written to deal with the fact that the parser works with references.
      - ParseError loses its lifetime and owns its contents, to avoid having to attach <'a> to Misfire.
      - The parser now takes an iterator instead of a slice.
      - OsStrings can’t be ‘match’ patterns, so the code devolves to using long Eq chains instead.
      - Make a change to the xtest that assumed an input argument with invalid UTF-8 in was always an error to stderr, when that now in fact works!
      - Fix a bug in Vagrant where ‘exa’ and ‘rexa’ didn’t properly escape filenames with spaces in.
      2d1f462b
  7. 06 7月, 2017 4 次提交
  8. 05 7月, 2017 1 次提交
    • B
      Much more thorough xattr testing · 882ac489
      Benjamin Sago 提交于
      It now tests a lot more combinations of xattrs on files, as well as xattrs and files and errors as the children of directories.
      
      The recent code changes have touched the part where directories’ xattrs and children are displayed at the same tree level, and there weren’t enough tests for this.
      882ac489
  9. 03 7月, 2017 1 次提交
    • B
      Generate files with certain timestamps · 5a2ffd3f
      Benjamin Sago 提交于
      This is going to be used to test time formatting.
      
      Casualty here is that the “have you not ran the provisioning script in a year?” checker complained about there being files more than a year old, so that now has to ignore the times directory.
      5a2ffd3f
  10. 29 6月, 2017 5 次提交
    • B
      Add sorting by type · f7505364
      Benjamin Sago 提交于
      This isn’t perfect, as a file’s type isn’t cached, so it gets recomputed for every comparison in the sort! We can’t go off the file’s `st_mode` flag because it’s not guaranteed to be in any order between systems.
      f7505364
    • B
      Add a test for inode sorting · 7d1448da
      Benjamin Sago 提交于
      7d1448da
    • B
      Add sort tests for name and ext and lowercase · 098788c9
      Benjamin Sago 提交于
      098788c9
    • B
      Upcase some of the extension testcases · 9d740911
      Benjamin Sago 提交于
      These are going to be used for sort testing. Unfortunately, three existing tests that were using the lowercase versions had to be changed.
      9d740911
    • B
      Override the names of . and .. · dd8bff08
      Benjamin Sago 提交于
      There was a problem when displaying . and .. in directory listings: their names would normalise to actual names! So instead of literally seeing `.`, you’d see the current directory’s name, inserted in sort order into the list of results. Obviously this is not what we want.
      
      In unrelated news, putting `.` and `..` into the list of paths read from a directory just takes up more heap space for something that’s basically constant.
      
      We can solve both these problems at once by moving the DotFilter to the files iterator in Dir, rather than at the Dir’s creation. Having the iterator know whether it should display `.` and `..` means it can emit those files first, and because it knows what those files really represent, it can override their file names to actually be those sequences of dots.
      
      This is not a perfect solution: the main casualty is that a File can now be constructed with a name, some metadata, both, or neither. This is currently handled with a bunch of Options, and returns IOResult even without doing any IO operations.
      
      But at least all the tests pass!
      dd8bff08
  11. 25 6月, 2017 2 次提交
    • B
      Fix bug where colours were incorrectly applied · 84b01f20
      Benjamin Sago 提交于
      exa assumed that the COLUMNS environment variable being present always meant that the output was to a terminal, so it should use colours. But because this variable can be overridden, colours were being incorrectly set!
      
      The ‘fix’ is to stop trying to be clever while only calculating the terminal width once, and instead just stick it in a lazy_static so it’s usable everywhere.
      84b01f20
    • B
      Tests for disabling colours · 4e90b4d7
      Benjamin Sago 提交于
      4e90b4d7
  12. 24 6月, 2017 3 次提交
  13. 19 5月, 2017 1 次提交
    • B
      Don’t core dump when given invalid UTF-8 arguments · de60b958
      Benjamin Sago 提交于
      By parsing OsStrings rather than Strings, it’s the getopts crate that’s doing the UTF-8 checking rather than us, so if one of them isn’t valid, it’ll just fail to parse rather than crash exa.
      
      Also, save a few allocations here and there.
      de60b958
  14. 18 5月, 2017 1 次提交
  15. 17 5月, 2017 1 次提交
  16. 16 5月, 2017 1 次提交
    • B
      Re-prefix the paths found by following symlinks · 108a402d
      Benjamin Sago 提交于
      Fixes #134, a bug that showed symlinks incorrectly as broken, but only when the file was listed directly on the command-line *and* the file was in a different directory to the one exa was being run in.
      
      I’m not sure why the old code used `String::new()`, but it doesn’t seem to affect anything.
      108a402d
  17. 03 5月, 2017 1 次提交
    • B
      Fix bug where paths took up twice as much space · ba1c8c65
      Benjamin Sago 提交于
      For some reason, the code that calculated the width of a cell with a path in counted the width of the path twice: once from the ANSIStrings containing it, and once more added on afterwards. This meant that the grid view thought that columns were wider than they really were, meaning fewer could be fit into a grid.
      ba1c8c65
  18. 02 5月, 2017 1 次提交
    • B
      Also escape characters in links and headings · 56d4d4c1
      Benjamin Sago 提交于
      Doing this meant that the escaping functionality got used in three places, so it was extracted into a generalised function in its own module.
      
      This is slighly slower for the case where escaped characters are displayed in the same colour as the displayable characters, which happens when listing a directory’s name when recursing. Optimise this, yeah?
      56d4d4c1
  19. 01 5月, 2017 1 次提交
    • B
      Only highlight escaped characters in file names · eb7e53ef
      Benjamin Sago 提交于
      Rather than the *entire* file name.
      
      The current method is extremely inefficient, but having control characters in file names is also extremely uncommon; it’s something that should be fixed, only eventually.
      eb7e53ef
  20. 29 4月, 2017 7 次提交
    • B
      Further tests for printing out directory names · 0c69eeca
      Benjamin Sago 提交于
      ., .., and / always seem to cause problems.
      0c69eeca
    • B
      oops · f8b82642
      Benjamin Sago 提交于
      I think I took this off to see how the output was different. Which means there should really be a better way to check how the output is different, other than running the command and looking!
      f8b82642
    • B
      Tests for the directory path fix · 3d97dffc
      Benjamin Sago 提交于
      3d97dffc
    • B
      Tests for classify and special file types · 456fa287
      Benjamin Sago 提交于
      456fa287
    • B
      Rename file-types tests to file-names-exts · bd5095d0
      Benjamin Sago 提交于
      This name more accurately reflects which code is being tested (things like .png and Makefile, rather than pipes and sockets), freeing up file-types for *actual* file types to be tested.
      bd5095d0
    • B
      Protect xtests against different default users · ef18f9ca
      Benjamin Sago 提交于
      The Vagrant tests assumed that there’d be a user called “vagrant” that would run the tests and create the files by default. Files would be owned by vagrant:vagrant by default, and this worked, until it came time to change that username. The naïve method was a search-and-replace, but this caused problems when the new user’s name wasn’t exactly the same length as the previous one.
      
      So to fix this, we now have our own user, named after the first animal I thought of, that makes the files’ owners and groups independent of the default user of whichever VM image the xtests are running on.
      
      Another place where it was hard-coded was the home directory, which was “/home/vagrant”, where the awkward testcases live. That last one has been changed to just “/testcases”, which has no mention of the user in it.
      ef18f9ca
    • B
      Protect xtests against the passage of time · b885b34a
      Benjamin Sago 提交于
      There was a problem with the Vagrant tests where the year 2016 was hard-coded in as the modified date. This had to be done to make the --long tests use the correct date format, which varies depending on whether the timestamp is in the current year.
      
      Unfortunately, time progresses [citation needed], and what was once 2016 is now 2017, so the date format changed and the tests broke.
      
      Because the Vagrantfile is just a Ruby script, we can look up the current year at runtime and use that instead. There’s also a check added to the test runner that makes sure none of the files are more than 365 days old, because if any are, then it’s time to update the timestamps (or it’s the last day of a leap year)
      b885b34a
  21. 30 10月, 2016 2 次提交
    • B
      Basic glob ignoring · 95596297
      Ben S 提交于
      See #97 and recently #130 too.
      
      This allows the user to pass in options such as "--ignore '*.pyc'" to not list any files ending in '.pyc' in the output. It uses the Rust glob crate and currently does a simple split on pipe, without any escaping, so it’s not really *complete*, but is at least something.
      95596297
    • B
      Fix integration test by making it time-independent · bd2a76b4
      Ben S 提交于
      bd2a76b4