From c27daf6a8ff27aafc8ae037b85711a695ffc9926 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 11 Dec 2023 13:27:23 -0800 Subject: [PATCH] Update tests --- tests/data/cases/expression.diff | 34 +++++++------------ .../expression_skip_magic_trailing_comma.diff | 34 +++++++------------ 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/tests/data/cases/expression.diff b/tests/data/cases/expression.diff index 2eaaeb4..28a8d5e 100644 --- a/tests/data/cases/expression.diff +++ b/tests/data/cases/expression.diff @@ -57,8 +57,8 @@ + if (1 if super_long_test_name else 2) + else (str or bytes or None) +) -+{"2.7": dead, "3.7": (long_live or die_hard)} -+{"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}} ++{"2.7": dead, "3.7": long_live or die_hard} ++{"2.7": dead, "3.7": long_live or die_hard, **{"3.6": verygood}} {**a, **b, **c} -{'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')} -({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None @@ -183,7 +183,7 @@ slice[0:1:2] slice[:] slice[:-1] -@@ -137,118 +173,199 @@ +@@ -137,118 +173,193 @@ numpy[-(c + 1) :, d] numpy[:, l[-2]] numpy[:, ::-1] @@ -283,30 +283,22 @@ -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message" -assert(((parens is TooMany))) -for x, in (1,), (2,), (3,): ... --for y in (): ... --for z in (i for i in (1, 2, 3)): ... --for i in (call()): ... --for j in (1 + (2 + 3)): ... --while(this and that): ... --for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'): +print(*lambda x: x) +assert not Test, "Short message" +assert this is ComplexTest and not requirements.fit_in_a_single_line( + force=False +), "Short message" +assert parens is TooMany -+for (x,) in (1,), (2,), (3,): -+ ... -+for y in (): -+ ... -+for z in (i for i in (1, 2, 3)): -+ ... -+for i in call(): -+ ... -+for j in 1 + (2 + 3): -+ ... -+while this and that: -+ ... ++for (x,) in (1,), (2,), (3,): ... + for y in (): ... + for z in (i for i in (1, 2, 3)): ... +-for i in (call()): ... +-for j in (1 + (2 + 3)): ... +-while(this and that): ... +-for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'): ++for i in call(): ... ++for j in 1 + (2 + 3): ... ++while this and that: ... +for ( + addr_family, + addr_type, diff --git a/tests/data/miscellaneous/expression_skip_magic_trailing_comma.diff b/tests/data/miscellaneous/expression_skip_magic_trailing_comma.diff index d17467b..d20ad0d 100644 --- a/tests/data/miscellaneous/expression_skip_magic_trailing_comma.diff +++ b/tests/data/miscellaneous/expression_skip_magic_trailing_comma.diff @@ -57,8 +57,8 @@ + if (1 if super_long_test_name else 2) + else (str or bytes or None) +) -+{"2.7": dead, "3.7": (long_live or die_hard)} -+{"2.7": dead, "3.7": (long_live or die_hard), **{"3.6": verygood}} ++{"2.7": dead, "3.7": long_live or die_hard} ++{"2.7": dead, "3.7": long_live or die_hard, **{"3.6": verygood}} {**a, **b, **c} -{'2.7', '3.6', '3.7', '3.8', '3.9', ('4.0' if gilectomy else '3.10')} -({'a': 'b'}, (True or False), (+value), 'string', b'bytes') or None @@ -167,7 +167,7 @@ slice[0:1:2] slice[:] slice[:-1] -@@ -137,118 +156,197 @@ +@@ -137,118 +156,191 @@ numpy[-(c + 1) :, d] numpy[:, l[-2]] numpy[:, ::-1] @@ -265,30 +265,22 @@ -assert this is ComplexTest and not requirements.fit_in_a_single_line(force=False), "Short message" -assert(((parens is TooMany))) -for x, in (1,), (2,), (3,): ... --for y in (): ... --for z in (i for i in (1, 2, 3)): ... --for i in (call()): ... --for j in (1 + (2 + 3)): ... --while(this and that): ... --for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'): +print(*lambda x: x) +assert not Test, "Short message" +assert this is ComplexTest and not requirements.fit_in_a_single_line( + force=False +), "Short message" +assert parens is TooMany -+for (x,) in (1,), (2,), (3,): -+ ... -+for y in (): -+ ... -+for z in (i for i in (1, 2, 3)): -+ ... -+for i in call(): -+ ... -+for j in 1 + (2 + 3): -+ ... -+while this and that: -+ ... ++for (x,) in (1,), (2,), (3,): ... + for y in (): ... + for z in (i for i in (1, 2, 3)): ... +-for i in (call()): ... +-for j in (1 + (2 + 3)): ... +-while(this and that): ... +-for addr_family, addr_type, addr_proto, addr_canonname, addr_sockaddr in socket.getaddrinfo('google.com', 'http'): ++for i in call(): ... ++for j in 1 + (2 + 3): ... ++while this and that: ... +for ( + addr_family, + addr_type,