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

/test/language/unclassified/position/test_position4.e

http://github.com/tybor/Liberty
Specman e | 71 lines | 41 code | 9 blank | 21 comment | 1 complexity | 5086d55743afae53781c3eeec4c265d3 MD5 | raw file
 1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
 2-- See the Copyright notice at the end of this file.
 3--
 4class TEST_POSITION4
 5
 6create {}
 7   make
 8
 9feature {ANY}
10   p1: AUX_POSITION
11
12   current_class_id: INTEGER
13
14   aux: AUX_POSITION4
15
16   pos (l, c: INTEGER): AUX_POSITION
17      require
18         l >= 1
19         c >= 1
20      do
21         Result.set(l, c, current_class_id.to_integer_16)
22      end
23
24   make
25      local
26         str: STRING
27      do
28         str := "...."
29         current_class_id := 3
30         p1 := pos(1, 2)
31         assert(p1.line = 1)
32         assert(p1.column = 2)
33         assert(p1.id = 3)
34         create aux.make(pos(4, 5))
35         assert(aux.position.line = 4)
36         assert(aux.position.column = 5)
37         assert(aux.position.id = 3)
38      end
39
40   assert (b: BOOLEAN)
41      do
42         cpt := cpt + 1
43         if not b then
44            std_output.put_string("TEST_POSITION4: ERROR Test # ")
45            std_output.put_integer(cpt)
46            std_output.put_string("%N")
47            crash
48         end
49      end
50
51   cpt: INTEGER
52
53end -- class TEST_POSITION4
54--
55-- ------------------------------------------------------------------------------------------------------------------------------
56-- Copyright notice below. Please read.
57--
58-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
59-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
60-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
61-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
62-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
63-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
64--
65-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
66-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
67--
68-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
69--
70-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
71-- ------------------------------------------------------------------------------------------------------------------------------