/test/lib/string/test_character4.e

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