File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3
3
@testset " stack allocated objects" begin
4
4
function f ()
5
5
t = 0
6
- while t < 4
6
+ while true
7
7
produce (t)
8
8
t = 1 + t
9
9
end
23
23
@testset " heap allocated objects" begin
24
24
function f ()
25
25
t = [0 1 2 ]
26
- for _ in 1 : 10
26
+ while true
27
27
produce (t[1 ])
28
28
t[1 ] = 1 + t[1 ]
29
29
end
44
44
@testset " iteration" begin
45
45
function f ()
46
46
t = 1
47
- for _ in 1 : 12
47
+ while true
48
48
produce (t)
49
49
t = 1 + t
50
50
end
73
73
@testset " method error" begin
74
74
function f ()
75
75
t = 0
76
- for _ in 1 : 3
76
+ while true
77
77
t[3 ] = 1
78
78
produce (t)
79
79
t = t + 1
94
94
@testset " error test" begin
95
95
function f ()
96
96
x = 1
97
- for _ in 1 : 3
97
+ while true
98
98
error (" error test" )
99
99
produce (x)
100
100
x += 1
115
115
@testset " OutOfBounds Test Before" begin
116
116
function f ()
117
117
x = zeros (2 )
118
- for _ in 1 : 3
118
+ while true
119
119
x[1 ] = 1
120
120
x[2 ] = 2
121
121
x[3 ] = 3
137
137
@testset " OutOfBounds Test After `produce`" begin
138
138
function f ()
139
139
x = zeros (2 )
140
- for _ in 1 : 3
140
+ while true
141
141
x[1 ] = 1
142
142
x[2 ] = 2
143
143
produce (x[2 ])
160
160
@testset " OutOfBounds Test After `copy`" begin
161
161
function f ()
162
162
x = zeros (2 )
163
- for _ in 1 : 3
163
+ while true
164
164
x[1 ] = 1
165
165
x[2 ] = 2
166
166
produce (x[2 ])
Original file line number Diff line number Diff line change 123
123
function f ()
124
124
t = TArray (Int, 1 )
125
125
t[1 ] = 0
126
- for _ in 1 : 10
126
+ while true
127
127
produce (t[1 ])
128
128
t[1 ]
129
129
t[1 ] = 1 + t[1 ]
You can’t perform that action at this time.
0 commit comments