PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lib/numeric/integer/test_integer_range.e

http://github.com/tybor/Liberty
Specman e | 23 lines | 18 code | 5 blank | 0 comment | 0 complexity | d605497806f7097cbd23598e3a075a41 MD5 | raw file
 1class TEST_INTEGER_RANGE
 2
 3insert
 4   EIFFELTEST_TOOLS
 5
 6create {}
 7   make
 8
 9feature {}
10   make
11      local
12         sum: INTEGER
13      do
14         sum := ({INTEGER 1} |..| {INTEGER 1000}).aggregate(agent add(?,?), 0)
15         assert(sum = (1000*1001)//2)
16      end
17
18   add (a, b: INTEGER): INTEGER
19      do
20         Result := a + b
21      end
22
23end