1. 10 8月, 2017 1 次提交
  2. 09 8月, 2017 2 次提交
    • B
      Decouple assert_eq! and assert_parses · 0b87392f
      Benjamin Sago 提交于
      The assert_parses function was problematic because it insisted on using assert_eq! to check its contents. This won’t work for any type we want to test that doesn’t implement PartialEq, such as TimeFormat, which holds references to years and date strings and other such.
      
      To go about fixing this, the first step is to change that function so it only does the initial processing, rather than the assertion, which is now done outside of it in the test macros instead.
      0b87392f
    • B
      Be stricter in strict mode · ff497b52
      Benjamin Sago 提交于
      Now the code actually starts to use the Strictness flag that was added in the earlier commit! Well, the *code* doesn’t, but the tests do: the macros that create the test cases now have a parameter for which tests they should run. It’s usually ‘Both’ for both strict mode and default mode, but can be specified to only run in one, for when the results differ (usually when options override one another)
      
      The downside to strict mode is that, now, *any* call to `matches.has` or `matches.get` could fail, because an option could have been specified twice, and this is the place where those are checked for. This makes the code a little less ergonomic in places, but that’s what the ? operator is for. The only place this has really had an effect is in `Classify::deduce`, which used to just return a boolean but can now fail.
      
      In order to more thoroughly test the mode, some of the older parts of the code can now act more strict. For example, `TerminalColours::deduce` will now use the last-given option rather than searching for “colours” before “colors”.
      
      Help and Version continue doing their own thing.
      ff497b52
  3. 08 8月, 2017 2 次提交
    • B
      Make these tests less long · d97f603e
      Benjamin Sago 提交于
      d97f603e
    • B
      Thread Strictness through the parser · 00379cce
      Benjamin Sago 提交于
      The value is ignored, but this broke quite a lot of tests that assumed MatchedFlags had only one field.
      
      Parsing tests have to have OsStr flags because I couldn’t get that part working right, but in general, some tests now re-use common functionality too.
      00379cce
  4. 07 8月, 2017 1 次提交
    • B
      Give IgnorePatterns a better interface · c1e20666
      Benjamin Sago 提交于
      This commit gives IgnorePatterns a bunch of constructor methods that mean its option-parsing sister file doesn’t need to know that it’s a vec of glob patterns inside: it can work with anything that iterates over strings. Now, the options module doesn’t need to know about the glob crate.
      c1e20666
  5. 06 8月, 2017 11 次提交
  6. 05 8月, 2017 5 次提交
  7. 04 8月, 2017 1 次提交
  8. 27 7月, 2017 8 次提交
    • B
      Add some tests for the time flags · 06157fde
      Benjamin Sago 提交于
      Apparently I forgot to give the --time flag an argument, and this wasn’t actually covered by any of the xtests! Well, it’s tested now.
      
      I’m not sure how to handle multiple --time arguments.
      06157fde
    • B
      Add tests for size format · 817c7d23
      Benjamin Sago 提交于
      817c7d23
    • B
      Add test for ignoring globs · adca0d36
      Benjamin Sago 提交于
      adca0d36
    • B
      Fix --tree --all · a2cd39e0
      Benjamin Sago 提交于
      Fixes #193. --all was treated the same as --all --all; now it’s treated differently.
      a2cd39e0
    • B
      Add tests for dot filters · 08315736
      Benjamin Sago 提交于
      08315736
    • B
      Add tests for sort field · bc5c0194
      Benjamin Sago 提交于
      **
      bc5c0194
    • B
      Streamline parser tests · 45e1cb77
      Benjamin Sago 提交于
      45e1cb77
    • 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
  9. 24 7月, 2017 1 次提交
    • B
      Move filter and dir_action from options to fs · 5b1966d2
      Benjamin Sago 提交于
      This commit moves the definitions of Filter and DirAction from the options module to the fs module, but leaves the parts that actually have to do with option parsing alone.
      
      Now, the options module shouldn’t define any types that get used elsewhere in the program: it only adds functionality to types that already exist.
      5b1966d2
  10. 23 7月, 2017 1 次提交
  11. 13 7月, 2017 7 次提交