Improve invariant tests for unflatten
Improve invariant tests for unflatten

Check both argument and return type.

NeilFraser/CodeCity,google/CodeCity,google/CodeCity,NeilFraser/CodeCity,NeilFraser/CodeCity,google/CodeCity,NeilFraser/CodeCity,google/CodeCity