/test/lib/numeric/integer/test_integer3.e

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