/test/lib/string/test_character1.e

http://github.com/tybor/Liberty · Specman e · 74 lines · 49 code · 4 blank · 21 comment · 0 complexity · 8619a715506c4186f06b485f3e038fc8 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_CHARACTER1
  5. insert
  6. EIFFELTEST_TOOLS
  7. create {}
  8. make
  9. feature {ANY}
  10. make
  11. do
  12. assert('a' = 'a')
  13. assert('a' < 'b')
  14. assert('a' <= 'b')
  15. assert('b' <= 'b')
  16. assert('a'.to_upper = 'A')
  17. assert('z'.to_upper = 'Z')
  18. assert('+'.to_upper = '+')
  19. assert('A'.to_lower = 'a')
  20. assert('Z'.to_lower = 'z')
  21. assert('+'.to_lower = '+')
  22. assert('0'.is_digit)
  23. assert('1'.is_digit)
  24. assert('2'.is_digit)
  25. assert('3'.is_digit)
  26. assert('4'.is_digit)
  27. assert('5'.is_digit)
  28. assert('6'.is_digit)
  29. assert('7'.is_digit)
  30. assert('8'.is_digit)
  31. assert('9'.is_digit)
  32. assert(not 'x'.is_digit)
  33. assert('0'.value = 0)
  34. assert('1'.value = 1)
  35. assert('2'.value = 2)
  36. assert('3'.value = 3)
  37. assert('4'.value = 4)
  38. assert('5'.value = 5)
  39. assert('6'.value = 6)
  40. assert('7'.value = 7)
  41. assert('8'.value = 8)
  42. assert('9'.value = 9)
  43. assert('a'.code = 97)
  44. assert('z'.code = 122)
  45. assert('A'.code = 65)
  46. assert('Z'.code = 90)
  47. assert('%/127/'.code = 127)
  48. assert('%/128/'.code = 128)
  49. assert('%/254/'.code = 254)
  50. assert('%/255/'.code = 255)
  51. end
  52. end -- class TEST_CHARACTER1
  53. --
  54. -- ------------------------------------------------------------------------------------------------------------------------------
  55. -- Copyright notice below. Please read.
  56. --
  57. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  58. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  59. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  60. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  61. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  62. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  63. --
  64. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  65. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  66. --
  67. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  68. --
  69. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  70. -- ------------------------------------------------------------------------------------------------------------------------------