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

/test/lib/numeric/number/test_number72.e

http://github.com/tybor/Liberty
Specman e | 82 lines | 53 code | 7 blank | 22 comment | 0 complexity | 12dd1d3341116cdfac6aea3804cff071 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_NUMBER72
 5   -- tests on "append_in"
 6
 7insert
 8   EIFFELTEST_TOOLS
 9   PLATFORM
10   NUMBER_TOOLS
11
12create {}
13   make
14
15feature {ANY}
16   s: STRING "hello"
17
18   make
19      local
20         s1, s2, s3: STRING; n: NUMBER
21      do
22         n := from_integer(1)
23         s1 := s.twin
24         n.append_in(s1)
25         assert(s1.is_equal("hello1"))
26         n := from_integer(-1)
27         s1 := s.twin
28         n.append_in(s1)
29         assert(s1.is_equal("hello-1"))
30         n := from_integer(0)
31         s1 := s.twin
32         n.append_in(s1)
33         assert(s1.is_equal("hello0"))
34         n := from_integer(Maximum_integer)
35         n := n @* 10
36         s1 := s.twin
37         n.append_in(s1)
38         s2 := s.twin
39         Maximum_integer.append_in(s2)
40         s3 := "0"
41         s2.append(s3)
42         assert(s1.is_equal(s2))
43         n := from_integer(Minimum_integer)
44         n := n @* 10
45         s1 := s.twin
46         n.append_in(s1)
47         s2 := s.twin
48         Minimum_integer.append_in(s2)
49         s3 := "0"
50         s2.append(s3)
51         assert(s1.is_equal(s2))
52         n := from_string("60/50")
53         s1 := s.twin
54         n.append_in(s1)
55         assert(s1.is_equal("hello6/5"))
56         n := from_string("-60/50")
57         s1 := s.twin
58         n.append_in(s1)
59         assert(s1.is_equal("hello-6/5"))
60      end
61
62
63
64end -- class TEST_NUMBER72
65--
66-- ------------------------------------------------------------------------------------------------------------------------------
67-- Copyright notice below. Please read.
68--
69-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
70-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
71-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
72-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
73-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
74-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
75--
76-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
77-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
78--
79-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
80--
81-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
82-- ------------------------------------------------------------------------------------------------------------------------------