brittany/data/12-features/minimize-parentheses.blt

32 lines
1.0 KiB
Plaintext

#group feature/minimize-parens
#golden minimize parens basic test
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func (abc) (def)
#expected
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func abc def
#test minimize parens test that it keep necessary parens
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func (abc False) ("asd" ++ "def")
#golden minimize nested parens 1
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func ((((((((nested))))))))
#expected
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func nested
#golden minimize nested parens 2
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func ((((((((nested + expression))))))))
#expected
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = func (nested + expression)
#test does not remove parens on InfixN
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
func = (a == Foo) == (b == Bar)