Skip to content

Commit cb5525c

Browse files
committed
move 3.0 spec files to the parent directory
1 parent e9f7caa commit cb5525c

File tree

5 files changed

+105
-103
lines changed

5 files changed

+105
-103
lines changed

spec/lib/rufo/formatter_source_specs/3.0/method_definition.rb.spec

-9
This file was deleted.

spec/lib/rufo/formatter_source_specs/3.0/pattern_matching.rb.spec

-94
This file was deleted.

spec/lib/rufo/formatter_source_specs/method_definition.rb.spec

+10
Original file line numberDiff line numberDiff line change
@@ -361,3 +361,13 @@ end
361361
def foo(...)
362362
p(...)
363363
end
364+
365+
#~# ORIGINAL partial_forward_args
366+
def foo(a, ...)
367+
p(...)
368+
end
369+
370+
#~# EXPECTED
371+
def foo(a, ...)
372+
p(...)
373+
end

spec/lib/rufo/formatter_source_specs/pattern_matching.rb.spec

+95
Original file line numberDiff line numberDiff line change
@@ -942,3 +942,98 @@ case x
942942
in Foo(*)
943943
1
944944
end
945+
946+
#~# ORIGINAL standalone (rightward assignment like syntax)
947+
948+
[0,1,2] => [a,*b]
949+
950+
#~# EXPECTED
951+
[0, 1, 2] => [a, *b]
952+
953+
#~# ORIGINAL find pattern
954+
955+
case [0]
956+
in [*x,
957+
0 => y ,*z]
958+
1
959+
end
960+
961+
#~# EXPECTED
962+
case [0]
963+
in [*x, 0 => y, *z]
964+
1
965+
end
966+
967+
#~# ORIGINAL find pattern unnamed rest args
968+
969+
case [0]
970+
in [*,0,*]
971+
1
972+
end
973+
974+
#~# EXPECTED
975+
case [0]
976+
in [*, 0, *]
977+
1
978+
end
979+
980+
#~# ORIGINAL find pattern multiple sub patterns
981+
982+
case [0,1,3]
983+
in [*,0,1,Integer=>y,*a]
984+
y+(a[0] || 1 )
985+
end
986+
987+
#~# EXPECTED
988+
case [0, 1, 3]
989+
in [*, 0, 1, Integer => y, *a]
990+
y + (a[0] || 1)
991+
end
992+
993+
#~# ORIGINAL find constant pattern with parens
994+
995+
case p
996+
in Point(*, 1,*a)
997+
a
998+
end
999+
1000+
#~# EXPECTED
1001+
case p
1002+
in Point(*, 1, *a)
1003+
a
1004+
end
1005+
1006+
#~# ORIGINAL find constant pattern with brackets
1007+
1008+
case p
1009+
in Point[ * , 1 , *a ]
1010+
a
1011+
end
1012+
1013+
#~# EXPECTED
1014+
case p
1015+
in Point[*, 1, *a]
1016+
a
1017+
end
1018+
1019+
#~# ORIGINAL issue_338
1020+
1021+
case
1022+
when true
1023+
end => { foo: }
1024+
1025+
#~# EXPECTED
1026+
case
1027+
when true
1028+
end => { foo: }
1029+
1030+
#~# ORIGINAL issue_338_2
1031+
1032+
case x
1033+
in true
1034+
end => { foo: }
1035+
1036+
#~# EXPECTED
1037+
case x
1038+
in true
1039+
end => { foo: }

0 commit comments

Comments
 (0)