1. 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
  2. 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
  3. 07 8月, 2017 7 次提交
  4. 06 8月, 2017 15 次提交
  5. 05 8月, 2017 5 次提交
  6. 04 8月, 2017 2 次提交
  7. 27 7月, 2017 7 次提交