Skip to content

Commit 38055ff

Browse files
committed
More tests.
1 parent d2d6e08 commit 38055ff

File tree

2 files changed

+366
-52
lines changed
  • tests/test-dirs/refactor-extract-region/func-extraction.t

2 files changed

+366
-52
lines changed

tests/test-dirs/refactor-extract-region/func-extraction.t/func.ml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ let test x y =
2020
in
2121
m
2222

23-
let map f =
24-
let rec loop acc = function
25-
| [] -> List.rev acc
26-
| x :: xs -> loop (f x :: acc) xs
27-
in
28-
loop []
29-
3023
let rec x = object end
3124

3225
and y _ =
@@ -65,7 +58,7 @@ and b = object end
6558

6659
let my_mutable_state =
6760
let var = ref 0 in
68-
var := 10 * 50;
61+
var := y * 50;
6962
!var
7063

7164
let func () =
@@ -86,3 +79,36 @@ and z x =
8679
method x = x
8780
method y = y
8881
end
82+
83+
let f = 0 + 1
84+
85+
let f x = (x * 2) + 3
86+
87+
let f x =
88+
let y = 0 in
89+
(x * y) + 3
90+
91+
let f x =
92+
let exception Local in
93+
raise Local
94+
95+
let x = 0
96+
let f x = x + 1
97+
98+
let x = 0
99+
let y = 1
100+
let f x = x + y
101+
102+
let f x = List.map (fun y -> y + 1) x
103+
104+
let f y =
105+
let y = y + 1 in
106+
y + 2
107+
108+
let f () = y + 1
109+
110+
let f x =
111+
let module M = struct
112+
let y = 0
113+
end in
114+
(x * M.y) + 3

0 commit comments

Comments
 (0)