@@ -111,13 +111,13 @@ fn run_spawn_many() {
111111}
112112
113113#[ test]
114- fn poll_one_returns_if_empty ( ) {
114+ fn try_run_one_returns_if_empty ( ) {
115115 let mut pool = LocalPool :: new ( ) ;
116- assert ! ( pool. poll_one ( ) == false ) ;
116+ assert ! ( pool. try_run_one ( ) == false ) ;
117117}
118118
119119#[ test]
120- fn poll_one_executes_one_ready ( ) {
120+ fn try_run_one_executes_one_ready ( ) {
121121 const ITER : usize = 200 ;
122122
123123 let cnt = Rc :: new ( Cell :: new ( 0 ) ) ;
@@ -139,14 +139,14 @@ fn poll_one_executes_one_ready() {
139139
140140 for i in 0 ..ITER {
141141 assert_eq ! ( cnt. get( ) , i) ;
142- assert ! ( pool. poll_one ( ) ) ;
142+ assert ! ( pool. try_run_one ( ) ) ;
143143 assert_eq ! ( cnt. get( ) , i + 1 ) ;
144144 }
145- assert ! ( pool. poll_one ( ) == false ) ;
145+ assert ! ( pool. try_run_one ( ) == false ) ;
146146}
147147
148148#[ test]
149- fn poll_one_returns_on_no_progress ( ) {
149+ fn try_run_one_returns_on_no_progress ( ) {
150150 const ITER : usize = 10 ;
151151
152152 let cnt = Rc :: new ( Cell :: new ( 0 ) ) ;
@@ -171,42 +171,42 @@ fn poll_one_returns_on_no_progress() {
171171
172172 for i in 0 ..ITER - 1 {
173173 assert_eq ! ( cnt. get( ) , i) ;
174- assert ! ( !pool. poll_one ( ) ) ;
174+ assert ! ( !pool. try_run_one ( ) ) ;
175175 assert_eq ! ( cnt. get( ) , i + 1 ) ;
176176 let w = waker. take ( ) ;
177177 assert ! ( w. is_some( ) ) ;
178178 w. unwrap ( ) . wake ( ) ;
179179 }
180- assert ! ( pool. poll_one ( ) ) ;
180+ assert ! ( pool. try_run_one ( ) ) ;
181181 assert_eq ! ( cnt. get( ) , ITER ) ;
182182}
183183
184184#[ test]
185- fn poll_returns_if_empty ( ) {
185+ fn run_until_stalled_returns_if_empty ( ) {
186186 let mut pool = LocalPool :: new ( ) ;
187- pool. poll ( ) ;
188- pool. poll ( ) ;
187+ pool. run_until_stalled ( ) ;
188+ pool. run_until_stalled ( ) ;
189189}
190190
191191#[ test]
192- fn poll_returns_multiple_times ( ) {
192+ fn run_until_stalled_returns_multiple_times ( ) {
193193 let mut pool = LocalPool :: new ( ) ;
194194 let mut spawn = pool. spawner ( ) ;
195195 let cnt = Rc :: new ( Cell :: new ( 0 ) ) ;
196196
197197 let cnt1 = cnt. clone ( ) ;
198198 spawn. spawn_local_obj ( Box :: pin ( lazy ( move |_|{ cnt1. set ( cnt1. get ( ) + 1 ) } ) ) . into ( ) ) . unwrap ( ) ;
199- pool. poll ( ) ;
199+ pool. run_until_stalled ( ) ;
200200 assert_eq ! ( cnt. get( ) , 1 ) ;
201201
202202 let cnt2 = cnt. clone ( ) ;
203203 spawn. spawn_local_obj ( Box :: pin ( lazy ( move |_|{ cnt2. set ( cnt2. get ( ) + 1 ) } ) ) . into ( ) ) . unwrap ( ) ;
204- pool. poll ( ) ;
204+ pool. run_until_stalled ( ) ;
205205 assert_eq ! ( cnt. get( ) , 2 ) ;
206206}
207207
208208#[ test]
209- fn poll_executes_all_ready ( ) {
209+ fn run_until_stalled_executes_all_ready ( ) {
210210 const ITER : usize = 200 ;
211211 const PER_ITER : usize = 3 ;
212212
@@ -229,7 +229,7 @@ fn poll_executes_all_ready() {
229229 spawn. spawn_local_obj ( Box :: pin ( pending ( ) ) . into ( ) ) . unwrap ( ) ;
230230 }
231231 assert_eq ! ( cnt. get( ) , i * PER_ITER ) ;
232- pool. poll ( ) ;
232+ pool. run_until_stalled ( ) ;
233233 assert_eq ! ( cnt. get( ) , ( i + 1 ) * PER_ITER ) ;
234234 }
235235}
@@ -250,13 +250,13 @@ fn nesting_run() {
250250
251251#[ test]
252252#[ should_panic]
253- fn nesting_run_poll ( ) {
253+ fn nesting_run_run_until_stalled ( ) {
254254 let mut pool = LocalPool :: new ( ) ;
255255 let mut spawn = pool. spawner ( ) ;
256256
257257 spawn. spawn_obj ( Box :: pin ( lazy ( |_| {
258258 let mut pool = LocalPool :: new ( ) ;
259- pool. poll ( ) ;
259+ pool. run_until_stalled ( ) ;
260260 } ) ) . into ( ) ) . unwrap ( ) ;
261261
262262 pool. run ( ) ;
0 commit comments