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