Skip to content

Commit bfa2197

Browse files
committed
nix duplicative tests
1 parent 7aa0255 commit bfa2197

1 file changed

Lines changed: 0 additions & 204 deletions

File tree

test/style/blocks_test.exs

Lines changed: 0 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -313,30 +313,6 @@ defmodule Styler.Style.BlocksTest do
313313
)
314314
end
315315

316-
test "block swapping comments - comments modify the bodies" do
317-
assert_style(
318-
"""
319-
case foo do
320-
false ->
321-
# a
322-
:error
323-
true ->
324-
# b
325-
:ok
326-
end
327-
""",
328-
"""
329-
if foo do
330-
# b
331-
:ok
332-
else
333-
# a
334-
:error
335-
end
336-
"""
337-
)
338-
end
339-
340316
test "complex comments" do
341317
assert_style(
342318
"""
@@ -1283,58 +1259,6 @@ defmodule Styler.Style.BlocksTest do
12831259
)
12841260
end
12851261
end
1286-
1287-
test "comments and flips" do
1288-
assert_style(
1289-
"""
1290-
if !a do
1291-
# b
1292-
b
1293-
else
1294-
# c
1295-
c
1296-
end
1297-
""",
1298-
"""
1299-
if a do
1300-
# c
1301-
c
1302-
else
1303-
# b
1304-
b
1305-
end
1306-
"""
1307-
)
1308-
end
1309-
end
1310-
1311-
describe "comment movement regressions" do
1312-
test "comments survive swap when do body is multiple lines (negated if)" do
1313-
assert_style(
1314-
"""
1315-
if !a do
1316-
# b1
1317-
b1
1318-
# b2
1319-
b2
1320-
else
1321-
# c
1322-
c
1323-
end
1324-
""",
1325-
"""
1326-
if a do
1327-
# c
1328-
c
1329-
else
1330-
# b1
1331-
b1
1332-
# b2
1333-
b2
1334-
end
1335-
"""
1336-
)
1337-
end
13381262
end
13391263

13401264
describe "block swap comment coverage" do
@@ -1423,68 +1347,6 @@ defmodule Styler.Style.BlocksTest do
14231347
)
14241348
end
14251349

1426-
test "1-statement do body swaps above a 3-statement else" do
1427-
assert_style(
1428-
"""
1429-
if !a do
1430-
# p
1431-
p
1432-
else
1433-
# q1
1434-
q1
1435-
# q2
1436-
q2
1437-
# q3
1438-
q3
1439-
end
1440-
""",
1441-
"""
1442-
if a do
1443-
# q1
1444-
q1
1445-
# q2
1446-
q2
1447-
# q3
1448-
q3
1449-
else
1450-
# p
1451-
p
1452-
end
1453-
"""
1454-
)
1455-
end
1456-
1457-
test "equal-size (2 statement) do/else bodies swap" do
1458-
assert_style(
1459-
"""
1460-
if !a do
1461-
# m1
1462-
m1
1463-
# m2
1464-
m2
1465-
else
1466-
# n1
1467-
n1
1468-
# n2
1469-
n2
1470-
end
1471-
""",
1472-
"""
1473-
if a do
1474-
# n1
1475-
n1
1476-
# n2
1477-
n2
1478-
else
1479-
# m1
1480-
m1
1481-
# m2
1482-
m2
1483-
end
1484-
"""
1485-
)
1486-
end
1487-
14881350
test "dangling comment at the end of a swapped do body" do
14891351
assert_style(
14901352
"""
@@ -1623,38 +1485,6 @@ defmodule Styler.Style.BlocksTest do
16231485
)
16241486
end
16251487

1626-
test "case to if with equal-size (2 statement) do/else bodies (false first)" do
1627-
assert_style(
1628-
"""
1629-
case foo do
1630-
false ->
1631-
# d1
1632-
d1
1633-
# d2
1634-
d2
1635-
true ->
1636-
# e1
1637-
e1
1638-
# e2
1639-
e2
1640-
end
1641-
""",
1642-
"""
1643-
if foo do
1644-
# e1
1645-
e1
1646-
# e2
1647-
e2
1648-
else
1649-
# d1
1650-
d1
1651-
# d2
1652-
d2
1653-
end
1654-
"""
1655-
)
1656-
end
1657-
16581488
test "cond to if with multi-line do body and 1-statement else" do
16591489
assert_style(
16601490
"""
@@ -1682,9 +1512,7 @@ defmodule Styler.Style.BlocksTest do
16821512
"""
16831513
)
16841514
end
1685-
end
16861515

1687-
describe "block swap comment coverage - suspected gaps" do
16881516
test "blank line breaks natural adjacency to the next clause" do
16891517
assert_style(
16901518
"""
@@ -1902,38 +1730,6 @@ defmodule Styler.Style.BlocksTest do
19021730
)
19031731
end
19041732

1905-
test "another" do
1906-
assert_style(
1907-
"""
1908-
case foo do
1909-
# a
1910-
false ->
1911-
# foo
1912-
d1
1913-
# b
1914-
true ->
1915-
# bar
1916-
e
1917-
f
1918-
# dangling
1919-
end
1920-
""",
1921-
"""
1922-
if foo do
1923-
# b
1924-
# bar
1925-
e
1926-
f
1927-
# dangling
1928-
else
1929-
# a
1930-
# foo
1931-
d1
1932-
end
1933-
"""
1934-
)
1935-
end
1936-
19371733
test "yet another" do
19381734
assert_style(
19391735
"""

0 commit comments

Comments
 (0)