Cherry-pick tests from "Make outer parentheses optional (see #2)"