PageRenderTime 22ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lib/misc/test_coroutine.e

http://github.com/tybor/Liberty
Specman e | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 6981aa8ef0a0a847f3dc20bc11c0cd68 MD5 | raw file
 1class TEST_COROUTINE
 2
 3insert
 4   EIFFELTEST_TOOLS
 5
 6create {}
 7   make
 8
 9feature {}
10   max: INTEGER 10
11
12   make
13      local
14         coro: AUX_COROUTINE
15         i: ITERATOR[INTEGER]
16         i_check: INTEGER
17      do
18         create coro.make(max)
19         from
20            i := coro.item([])
21         until
22            i.is_off
23         loop
24            i_check := i_check + 1
25            assert(i.item = i_check)
26            i.next
27         end
28         assert(i_check = max)
29      end
30
31end