Skip to content
Snippets Groups Projects
  1. Oct 26, 2012
    • Iustin Pop's avatar
      Fix a few issues found by newer hlint · 66ad857a
      Iustin Pop authored
      
      Testing with a newer hlint found a few minor issues; but all are real,
      valid recommendations:
      
      - don't use "if cond then f x else f y", but "f (if cond then x else y)"
      - "if a then b else True" is equivalent to the simpler "not a || b"
      - and as usual, one more ignore to our "testing basic properties"
        module
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      66ad857a
    • Iustin Pop's avatar
      Add a simple unittest for THH code · f51eacf3
      Iustin Pop authored
      
      This is very THH specific, and applies to all serialisations generated
      by THH, so I'm adding it in its own module.
      
      Probably we should add some more generic tests, but in general THH
      code is tested by the various definitions; this new field type however
      is not (yet), so this is why I want this specific unittest.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      f51eacf3
    • Iustin Pop's avatar
      Add support for optional fields with null serialised · 9b156883
      Iustin Pop authored
      
      This follows a conversation we had for how to deal with
      optional-but-required fields in JSON serialisations: fields which are
      optional (can be either a given type or 'null'), but where the 'null'
      value is required. There are just a few of these in the Python code,
      but we should support them nevertheless.
      
      The patch changes the 'isOptional' attribute from boolean to a custom
      ADT, three-typed. This allows us to keep the same path on load (which
      deals with both cases), but use a custom save path where we explicitly
      save the 'null' value.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      9b156883
  2. Oct 25, 2012
  3. Oct 24, 2012
  4. Oct 23, 2012
  5. Oct 22, 2012
  6. Oct 19, 2012
Loading