PageRenderTime 21ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/unclassified/jvm/test_jvm19.e

http://github.com/tybor/Liberty
Specman e | 96 lines | 68 code | 6 blank | 22 comment | 1 complexity | 46fea985b2d8b6ed0441e305d0fccd19 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_JVM19
 5
 6create {}
 7   make
 8
 9feature {ANY}
10   aa: RING_ARRAY[CHARACTER]
11
12   make
13      local
14         cr: REFERENCE[CHARACTER]; a: ANY_REFERENCE
15      do
16         assert('a' = 'a')
17         assert('a' < 'b')
18         assert('a' <= 'b')
19         assert('b' <= 'b')
20         assert('a'.to_upper = 'A')
21         assert('z'.to_upper = 'Z')
22         assert('+'.to_upper = '+')
23         assert('A'.to_lower = 'a')
24         assert('Z'.to_lower = 'z')
25         assert('+'.to_lower = '+')
26         assert('0'.is_digit)
27         assert('1'.is_digit)
28         assert('2'.is_digit)
29         assert('3'.is_digit)
30         assert('4'.is_digit)
31         assert('5'.is_digit)
32         assert('6'.is_digit)
33         assert('7'.is_digit)
34         assert('8'.is_digit)
35         assert('9'.is_digit)
36         assert(not 'x'.is_digit)
37         assert('0'.value = 0)
38         assert('1'.value = 1)
39         assert('2'.value = 2)
40         assert('3'.value = 3)
41         assert('4'.value = 4)
42         assert('5'.value = 5)
43         assert('6'.value = 6)
44         assert('7'.value = 7)
45         assert('8'.value = 8)
46         assert('9'.value = 9)
47         assert('a'.code = 97)
48         assert('z'.code = 122)
49         assert('A'.code = 65)
50         assert('Z'.code = 90)
51         create cr.set_item('x')
52         assert(cr.item = 'x')
53         a := create {REFERENCE[CHARACTER]}.set_item('x')
54         create aa.make(1, 1)
55         aa.put('a', 1)
56         assert('a' = aa.item(1))
57         assert('a'.is_equal(aa.item(1)))
58         assert('a'.is_equal(aa.item(1)))
59         assert(97 = aa.first.code)
60         assert(97 = aa.item(1).code)
61      end
62
63   assert (b: BOOLEAN)
64      do
65         cpt := cpt + 1
66         if not b then
67            sedb_breakpoint
68            std_output.put_string("TEST_JVM19: ERROR Test # ")
69            std_output.put_integer(cpt)
70            std_output.put_string("%N")
71         else
72            -- std_output.put_string("Yes%N")
73         end
74      end
75
76   cpt: INTEGER
77
78end -- class TEST_JVM19
79--
80-- ------------------------------------------------------------------------------------------------------------------------------
81-- Copyright notice below. Please read.
82--
83-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
84-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
85-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
86-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
87-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
88-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
89--
90-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
91-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
92--
93-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
94--
95-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
96-- ------------------------------------------------------------------------------------------------------------------------------